Enable clippy::option_map_unit_fn
(#8751)
This PR enables the [`clippy::option_map_unit_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_map_unit_fn) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
d19957b705
commit
ea68f86476
8 changed files with 75 additions and 55 deletions
|
@ -631,14 +631,12 @@ impl ChatPanel {
|
|||
"Copy message text",
|
||||
None,
|
||||
cx.handler_for(&this, move |this, cx| {
|
||||
this.active_chat().map(|active_chat| {
|
||||
if let Some(message) =
|
||||
active_chat.read(cx).find_loaded_message(message_id)
|
||||
{
|
||||
let text = message.body.clone();
|
||||
cx.write_to_clipboard(ClipboardItem::new(text))
|
||||
}
|
||||
});
|
||||
if let Some(message) = this.active_chat().and_then(|active_chat| {
|
||||
active_chat.read(cx).find_loaded_message(message_id)
|
||||
}) {
|
||||
let text = message.body.clone();
|
||||
cx.write_to_clipboard(ClipboardItem::new(text))
|
||||
}
|
||||
}),
|
||||
)
|
||||
.when(can_delete_message, move |menu| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue