diff options
| author | Dion Dokter <[email protected]> | 2025-09-18 11:06:33 +0200 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2025-09-18 11:06:33 +0200 |
| commit | b794997c56a7111b2c628b978486b7252ae98e26 (patch) | |
| tree | 75a84af33b82d332d14cb45d4923ee94b6d99e79 /embassy-embedded-hal/src/flash | |
| parent | 6c801a0dba93680c8e41e611eada0576eab0f861 (diff) | |
Clippy fixes
Diffstat (limited to 'embassy-embedded-hal/src/flash')
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/asynch.rs | 6 | ||||
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/blocking.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/embassy-embedded-hal/src/flash/partition/asynch.rs b/embassy-embedded-hal/src/flash/partition/asynch.rs index 82e27bb7c..a6fa2a562 100644 --- a/embassy-embedded-hal/src/flash/partition/asynch.rs +++ b/embassy-embedded-hal/src/flash/partition/asynch.rs | |||
| @@ -119,7 +119,7 @@ mod tests { | |||
| 119 | let mut read_buf = [0; 8]; | 119 | let mut read_buf = [0; 8]; |
| 120 | partition.read(4, &mut read_buf).await.unwrap(); | 120 | partition.read(4, &mut read_buf).await.unwrap(); |
| 121 | 121 | ||
| 122 | assert!(read_buf.iter().position(|&x| x != 0xAA).is_none()); | 122 | assert!(!read_buf.iter().any(|&x| x != 0xAA)); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | #[futures_test::test] | 125 | #[futures_test::test] |
| @@ -133,7 +133,7 @@ mod tests { | |||
| 133 | partition.write(4, &write_buf).await.unwrap(); | 133 | partition.write(4, &write_buf).await.unwrap(); |
| 134 | 134 | ||
| 135 | let flash = flash.try_lock().unwrap(); | 135 | let flash = flash.try_lock().unwrap(); |
| 136 | assert!(flash.mem[132..132 + 8].iter().position(|&x| x != 0xAA).is_none()); | 136 | assert!(!flash.mem[132..132 + 8].iter().any(|&x| x != 0xAA)); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | #[futures_test::test] | 139 | #[futures_test::test] |
| @@ -146,6 +146,6 @@ mod tests { | |||
| 146 | partition.erase(0, 128).await.unwrap(); | 146 | partition.erase(0, 128).await.unwrap(); |
| 147 | 147 | ||
| 148 | let flash = flash.try_lock().unwrap(); | 148 | let flash = flash.try_lock().unwrap(); |
| 149 | assert!(flash.mem[128..256].iter().position(|&x| x != 0xFF).is_none()); | 149 | assert!(!flash.mem[128..256].iter().any(|&x| x != 0xFF)); |
| 150 | } | 150 | } |
| 151 | } | 151 | } |
diff --git a/embassy-embedded-hal/src/flash/partition/blocking.rs b/embassy-embedded-hal/src/flash/partition/blocking.rs index 951998166..cb30290a8 100644 --- a/embassy-embedded-hal/src/flash/partition/blocking.rs +++ b/embassy-embedded-hal/src/flash/partition/blocking.rs | |||
| @@ -129,7 +129,7 @@ mod tests { | |||
| 129 | let mut read_buf = [0; 8]; | 129 | let mut read_buf = [0; 8]; |
| 130 | partition.read(4, &mut read_buf).unwrap(); | 130 | partition.read(4, &mut read_buf).unwrap(); |
| 131 | 131 | ||
| 132 | assert!(read_buf.iter().position(|&x| x != 0xAA).is_none()); | 132 | assert!(!read_buf.iter().any(|&x| x != 0xAA)); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | #[test] | 135 | #[test] |
| @@ -143,7 +143,7 @@ mod tests { | |||
| 143 | partition.write(4, &write_buf).unwrap(); | 143 | partition.write(4, &write_buf).unwrap(); |
| 144 | 144 | ||
| 145 | let flash = flash.into_inner().take(); | 145 | let flash = flash.into_inner().take(); |
| 146 | assert!(flash.mem[132..132 + 8].iter().position(|&x| x != 0xAA).is_none()); | 146 | assert!(!flash.mem[132..132 + 8].iter().any(|&x| x != 0xAA)); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | #[test] | 149 | #[test] |
| @@ -156,6 +156,6 @@ mod tests { | |||
| 156 | partition.erase(0, 128).unwrap(); | 156 | partition.erase(0, 128).unwrap(); |
| 157 | 157 | ||
| 158 | let flash = flash.into_inner().take(); | 158 | let flash = flash.into_inner().take(); |
| 159 | assert!(flash.mem[128..256].iter().position(|&x| x != 0xFF).is_none()); | 159 | assert!(!flash.mem[128..256].iter().any(|&x| x != 0xFF)); |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
