Skip to content

Commit

Permalink
lint: Silence a clippy::single_match warning
Browse files Browse the repository at this point in the history
This warning is documented as being just for "readability" via making
the body less nested:
  https://rust-lang.github.io/rust-clippy/master/index.html#single_match

But here, we have several neighboring matches on the same structure
which can't be simplified this way.  It's better to keep this bit
parallel to those, rather than to simplify it in isolation.
  • Loading branch information
gnprice committed Dec 3, 2022
1 parent 9219320 commit c4b5564
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ fn set(path: PathBuf, query: &str, value_str: &str) -> Result<(), Error> {
if n >= &len {
Err(CliError::ArrayIndexOob())?;
}
#[allow(clippy::single_match)]
match &item { Item::Value(_) => already_inline = true, _ => () };
item = &mut item[n];
}
Expand Down

0 comments on commit c4b5564

Please sign in to comment.