Fix clippy::manual_map
lint violations (#36584)
#36577 Release Notes: - N/A
This commit is contained in:
parent
de12633591
commit
bc79076ad3
18 changed files with 62 additions and 118 deletions
|
@ -21065,13 +21065,7 @@ fn add_log_breakpoint_at_cursor(
|
|||
let (anchor, bp) = editor
|
||||
.breakpoints_at_cursors(window, cx)
|
||||
.first()
|
||||
.and_then(|(anchor, bp)| {
|
||||
if let Some(bp) = bp {
|
||||
Some((*anchor, bp.clone()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.and_then(|(anchor, bp)| bp.as_ref().map(|bp| (*anchor, bp.clone())))
|
||||
.unwrap_or_else(|| {
|
||||
let cursor_position: Point = editor.selections.newest(cx).head();
|
||||
|
||||
|
|
|
@ -174,11 +174,9 @@ pub fn hover_at_inlay(
|
|||
|
||||
let subscription = this
|
||||
.update(cx, |_, cx| {
|
||||
if let Some(parsed_content) = &parsed_content {
|
||||
Some(cx.observe(parsed_content, |_, _, cx| cx.notify()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
parsed_content.as_ref().map(|parsed_content| {
|
||||
cx.observe(parsed_content, |_, _, cx| cx.notify())
|
||||
})
|
||||
})
|
||||
.ok()
|
||||
.flatten();
|
||||
|
@ -450,11 +448,9 @@ fn show_hover(
|
|||
let scroll_handle = ScrollHandle::new();
|
||||
let subscription = this
|
||||
.update(cx, |_, cx| {
|
||||
if let Some(parsed_content) = &parsed_content {
|
||||
Some(cx.observe(parsed_content, |_, _, cx| cx.notify()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
parsed_content.as_ref().map(|parsed_content| {
|
||||
cx.observe(parsed_content, |_, _, cx| cx.notify())
|
||||
})
|
||||
})
|
||||
.ok()
|
||||
.flatten();
|
||||
|
@ -502,11 +498,9 @@ fn show_hover(
|
|||
hover_highlights.push(range.clone());
|
||||
let subscription = this
|
||||
.update(cx, |_, cx| {
|
||||
if let Some(parsed_content) = &parsed_content {
|
||||
Some(cx.observe(parsed_content, |_, _, cx| cx.notify()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
parsed_content.as_ref().map(|parsed_content| {
|
||||
cx.observe(parsed_content, |_, _, cx| cx.notify())
|
||||
})
|
||||
})
|
||||
.ok()
|
||||
.flatten();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue