Skip to content

Commit 28dfbb5

Browse files
Silence a new clippy warning (#113)
Silence a number of new clippy warnings, including 'assigning the result of `Clone::clone()` may be inefficient'
1 parent db1a26f commit 28dfbb5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: src/bin/kp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn transform(
185185
// to compute the roundtrip differences
186186
let mut buffer = Vec::new();
187187
if options.roundtrip {
188-
buffer = operands.clone();
188+
buffer.clone_from(operands);
189189
}
190190

191191
let mut n = if options.inverse {

Diff for: src/grid/ntv2/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ impl Ntv2Grid {
8686
continue;
8787
}
8888

89-
current_grid_id = grid_id.clone();
89+
current_grid_id.clone_from(&grid_id);
9090

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

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

212212
Ok(())
213213
}

Diff for: src/op/parsed_parameters.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,12 @@ mod tests {
535535

536536
// Booleans correctly parsed?
537537
assert!(
538-
p.boolean.get("flag").is_some(),
538+
p.boolean.contains("flag"),
539539
"`flag` not in registered booleans: {:#?}",
540540
p.boolean
541541
);
542542
assert!(
543-
p.boolean.get("galf").is_none(),
543+
!p.boolean.contains("galf"),
544544
"`galf` not in registered booleans: {:?}",
545545
p.boolean
546546
);

0 commit comments

Comments
 (0)