Skip to content

Commit

Permalink
Fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
crodas committed Feb 15, 2024
1 parent c7015d0 commit ca1e203
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions forc/src/cli/commands/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub(crate) fn exec(command: Command) -> ForcResult<()> {
.collect::<Vec<_>>();
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),
Expand All @@ -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(());
}
}

Expand Down

0 comments on commit ca1e203

Please sign in to comment.