Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Flemmli97 committed Jan 30, 2024
1 parent c45acd5 commit b92a457
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions common/src/warp_runner/ui_adapter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ impl Message {
pub fn is_mention_self(&mut self, own: &DID) -> bool {
if self.is_mention.is_none() {
let reg = mention_regex_epattern(&own.to_string());
match reg.find(&self.inner.lines().join("\n")) {
Some(c) => self.is_mention = Some(!c.as_str().starts_with('`')),
None => self.is_mention = Some(false),
}
self.is_mention = Some(
reg.find(&self.inner.lines().join("\n"))
.map(|c| !c.as_str().starts_with('`'))
.unwrap_or_default(),
);
}
self.is_mention.unwrap()
}
Expand Down

0 comments on commit b92a457

Please sign in to comment.