Skip to content

Commit

Permalink
Fixed Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-meissner committed Jan 30, 2024
1 parent 583a930 commit e6678af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,7 @@ impl<T: DeviceTypes> Copy for Voltage<T> {}

impl<T: DeviceTypes> Clone for Voltage<T> {
fn clone(&self) -> Self {
Self {
channel: self.channel,
voltage: self.voltage,
}
*self
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/tests/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,10 @@ fn test_read_voltages_gpio_all() {

assert_eq!(Channel::SecondReference, result[0][9].channel);
assert_eq!(7330, result[0][9].voltage);

// Assert cloning is working
let cloned_voltage = result[0][0];
assert_eq!(24979, cloned_voltage.voltage);
}

#[test]
Expand Down

0 comments on commit e6678af

Please sign in to comment.