From ca1e203056cddc2dfc8655d1db8ac9e660c9b57d Mon Sep 17 00:00:00 2001 From: Cesar Rodas Date: Thu, 15 Feb 2024 17:18:26 -0300 Subject: [PATCH] Fix clippy issues --- forc/src/cli/commands/completions.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/forc/src/cli/commands/completions.rs b/forc/src/cli/commands/completions.rs index 39ce52ea108..d04338156bc 100644 --- a/forc/src/cli/commands/completions.rs +++ b/forc/src/cli/commands/completions.rs @@ -128,7 +128,7 @@ pub(crate) fn exec(command: Command) -> ForcResult<()> { .collect::>(); format!( "{}/_forc", - paths.get(0).expect("No writable path found for zsh") + paths.first().expect("No writable path found for zsh") ) } _ => format!("{}/.forc.autocomplete", dir), @@ -153,12 +153,10 @@ pub(crate) fn exec(command: Command) -> ForcResult<()> { let file = File::open(&file_path).expect("Open the shell config file"); let reader = BufReader::new(file); - for line in reader.lines() { - if let Ok(line) = line { - if line.contains(&forc_autocomplete_path) { - println!("Forc completions is already installed"); - return Ok(()); - } + for line in reader.lines().flatten() { + if line.contains(&forc_autocomplete_path) { + println!("Forc completions is already installed"); + return Ok(()); } }