diff --git a/src/bin/kp.rs b/src/bin/kp.rs index 9e03e20..71072d4 100644 --- a/src/bin/kp.rs +++ b/src/bin/kp.rs @@ -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 { diff --git a/src/grid/ntv2/mod.rs b/src/grid/ntv2/mod.rs index a1da29d..83627f8 100644 --- a/src/grid/ntv2/mod.rs +++ b/src/grid/ntv2/mod.rs @@ -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(¤t_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; @@ -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(()) } diff --git a/src/op/parsed_parameters.rs b/src/op/parsed_parameters.rs index 6e850af..0e67ecf 100644 --- a/src/op/parsed_parameters.rs +++ b/src/op/parsed_parameters.rs @@ -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 );