Skip to content

Commit

Permalink
Silence a new clippy warning (#113)
Browse files Browse the repository at this point in the history
Silence a number of new clippy warnings, including 'assigning the result of `Clone::clone()` may be inefficient'
  • Loading branch information
busstoptaktik authored May 3, 2024
1 parent db1a26f commit 28dfbb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bin/kp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn transform(
// to compute the roundtrip differences
let mut buffer = Vec::new();
if options.roundtrip {
buffer = operands.clone();
buffer.clone_from(operands);
}

let mut n = if options.inverse {
Expand Down
6 changes: 3 additions & 3 deletions src/grid/ntv2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ impl Ntv2Grid {
continue;
}

current_grid_id = grid_id.clone();
current_grid_id.clone_from(&grid_id);

if let Some(children) = self.lookup_table.get(&current_grid_id) {
queue = children.clone();
queue.clone_from(children);
} else {
// If we get here it means the current_parent_id has no children and we've found the grid
break;
Expand Down Expand Up @@ -207,7 +207,7 @@ mod tests {
.contains(&"5458".to_string()));

// Grids with no children do not appear in the lookup table
assert!(ntv2_grid.lookup_table.get("5556").is_none());
assert!(!ntv2_grid.lookup_table.contains_key("5556"));

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/op/parsed_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,12 @@ mod tests {

// Booleans correctly parsed?
assert!(
p.boolean.get("flag").is_some(),
p.boolean.contains("flag"),
"`flag` not in registered booleans: {:#?}",
p.boolean
);
assert!(
p.boolean.get("galf").is_none(),
!p.boolean.contains("galf"),
"`galf` not in registered booleans: {:?}",
p.boolean
);
Expand Down

0 comments on commit 28dfbb5

Please sign in to comment.