From 814dcfa8d234e5031313b050b851641da8e6359b Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sun, 26 Sep 2021 21:54:36 +0300 Subject: [PATCH] fix lints --- helix-dap/src/client.rs | 2 +- helix-term/src/commands/dap.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 832a70c2..72aff5d2 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -54,7 +54,7 @@ impl Client { port_arg: Option, id: usize, ) -> Result<(Self, UnboundedReceiver)> { - if command == "" { + if command.is_empty() { return Result::Err(Error::Other(anyhow!("Command not provided"))); } if transport == "tcp" && port_arg.is_some() { diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index 3f925490..a7cf7e81 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -232,9 +232,10 @@ pub fn dap_start_impl( if cfg.completion == Some("filename".to_owned()) || cfg.completion == Some("directory".to_owned()) { - param = std::fs::canonicalize(x).ok() + param = std::fs::canonicalize(x) + .ok() .and_then(|pb| pb.into_os_string().into_string().ok()) - .unwrap_or(x.to_string()); + .unwrap_or_else(|| x.to_string()); } } // For param #0 replace {0} in args