diff --git a/examples/monitor-shtc3.rs b/examples/monitor-shtc3.rs index fa78f6e..e5bc4ab 100644 --- a/examples/monitor-shtc3.rs +++ b/examples/monitor-shtc3.rs @@ -147,7 +147,7 @@ fn show_chart( .name("Low power mode") .marker(Marker::Braille) .style(Style::default().fg(color_lowpwr)) - .data(&data_lowpwr), + .data(data_lowpwr), Dataset::default() .name("Normal mode") .marker(Marker::Dot) @@ -175,7 +175,7 @@ fn show_chart( fn render(terminal: &mut Terminal>>, data: &Data) { terminal - .draw(|mut f| { + .draw(|f| { let chunks = Layout::default() .direction(Direction::Vertical) .margin(1) @@ -216,7 +216,7 @@ fn render(terminal: &mut Terminal>>, data: Color::Red, temp_lowpwr.as_slice(), Color::Magenta, - &mut f, + f, chunks[0], ); show_chart( @@ -226,7 +226,7 @@ fn render(terminal: &mut Terminal>>, data: Color::Blue, humi_lowpwr.as_slice(), Color::Cyan, - &mut f, + f, chunks[1], ); }) diff --git a/src/types.rs b/src/types.rs index 7927b1f..136b347 100644 --- a/src/types.rs +++ b/src/types.rs @@ -98,7 +98,7 @@ mod tests { let test_data = [ (0x0000, -45000), // Datasheet setion 5.11 "Conversion of Sensor Output" - (((0b0110_0100 as u16) << 8) | 0b1000_1011, 23730), + ((0b0110_0100_u16 << 8) | 0b1000_1011, 23730), ]; for td in &test_data { assert_eq!(convert_temperature(td.0), td.1); @@ -111,7 +111,7 @@ mod tests { let test_data = [ (0x0000, 0), // Datasheet setion 5.11 "Conversion of Sensor Output" - (((0b1010_0001 as u16) << 8) | 0b0011_0011, 62968), + ((0b1010_0001_u16 << 8) | 0b0011_0011, 62968), ]; for td in &test_data { assert_eq!(convert_humidity(td.0), td.1); @@ -122,8 +122,8 @@ mod tests { #[test] fn measurement_conversion() { // Datasheet setion 5.11 "Conversion of Sensor Output" - let temperature = convert_temperature(((0b0110_0100 as u16) << 8) | 0b1000_1011); - let humidity = convert_humidity(((0b1010_0001 as u16) << 8) | 0b0011_0011); + let temperature = convert_temperature((0b0110_0100_u16 << 8) | 0b1000_1011); + let humidity = convert_humidity((0b1010_0001_u16 << 8) | 0b0011_0011); assert_eq!(temperature, 23730); assert_eq!(humidity, 62968); } @@ -146,8 +146,8 @@ mod tests { fn measurement_from_into() { // Datasheet setion 5.11 "Conversion of Sensor Output" let raw = RawMeasurement { - temperature: ((0b0110_0100 as u16) << 8) | 0b1000_1011, - humidity: ((0b1010_0001 as u16) << 8) | 0b0011_0011, + temperature: (0b0110_0100_u16 << 8) | 0b1000_1011, + humidity: (0b1010_0001_u16 << 8) | 0b0011_0011, }; // std::convert::From