Fix clippy warnings

pull/574/head
Dmitry Sharshakov 3 years ago
parent 6458edecfd
commit 5f5b383979
No known key found for this signature in database
GPG Key ID: 471FD32E15FD8473

@ -4288,10 +4288,10 @@ async fn dap_listen_stopped(
.threads() .threads()
.await .await
.ok() .ok()
.and_then(|threads| threads.get(0).and_then(|x| Some(x.clone()))); .and_then(|threads| threads.get(0).cloned());
if let Some(main) = main { if let Some(main) = main {
let (a, _) = dbg.stack_trace(main.id).await.unwrap(); let (a, _) = dbg.stack_trace(main.id).await.unwrap();
dbg.stack_pointer = a.get(0).and_then(|x| Some(x.clone())); dbg.stack_pointer = a.get(0).cloned();
} }
} }
} }

@ -450,7 +450,7 @@ impl EditorView {
if let Some(debugger) = debugger { if let Some(debugger) = debugger {
if let Some(path) = doc.path() { if let Some(path) = doc.path() {
let dbg = block_on(debugger.lock()); let dbg = block_on(debugger.lock());
breakpoints = dbg.breakpoints.get(path).and_then(|bps| Some(bps.clone())); breakpoints = dbg.breakpoints.get(path).cloned();
stack_pointer = dbg.stack_pointer.clone() stack_pointer = dbg.stack_pointer.clone()
} }
} }
@ -475,7 +475,7 @@ impl EditorView {
let selected = cursors.contains(&line); let selected = cursors.contains(&line);
if let Some(bps) = breakpoints.as_ref() { if let Some(bps) = breakpoints.as_ref() {
if let Some(_) = bps.iter().find(|breakpoint| breakpoint.line == line) { if bps.iter().any(|breakpoint| breakpoint.line == line) {
surface.set_stringn(viewport.x, viewport.y + i as u16, "▲", 1, warning); surface.set_stringn(viewport.x, viewport.y + i as u16, "▲", 1, warning);
} }
} }
@ -484,7 +484,7 @@ impl EditorView {
if let Some(src) = sp.source.as_ref() { if let Some(src) = sp.source.as_ref() {
if doc if doc
.path() .path()
.and_then(|path| Some(src.path == Some(path.clone()))) .map(|path| src.path == Some(path.clone()))
.unwrap_or(false) .unwrap_or(false)
&& sp.line == line && sp.line == line
{ {
@ -1045,7 +1045,7 @@ impl Component for EditorView {
let loader = &cx.editor.syn_loader; let loader = &cx.editor.syn_loader;
let mut dbg: Option<Arc<Mutex<helix_dap::Client>>> = None; let mut dbg: Option<Arc<Mutex<helix_dap::Client>>> = None;
if let Some(debugger) = &cx.editor.debugger { if let Some(debugger) = &cx.editor.debugger {
dbg = Some(Arc::clone(&debugger)); dbg = Some(Arc::clone(debugger));
} }
self.render_view( self.render_view(
doc, doc,

Loading…
Cancel
Save