We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f583724 commit a7af010Copy full SHA for a7af010
src/leds.rs
@@ -196,8 +196,11 @@ impl<'a> Iterator for LedsMutIterator<'a> {
196
} else {
197
let current = unsafe {
198
//Safety: Each branch is only executed once,
199
+ // and only if there are elements left to be returned,
200
// so we can not possibly alias a mutable reference.
- // Oddly, this depends on DoubleSidedIterator also being implemented correctly.
201
+ // This depends on DoubleEndedIterator and ExactSizedIterator being implemented correctly.
202
+ // If len() does not return the correct number of remaining elements,
203
+ // this becomes unsound.
204
match self.index {
205
0 => Some(&mut *(&mut self.leds.ld3 as *mut _)), //N
206
1 => Some(&mut *(&mut self.leds.ld5 as *mut _)), //NE
0 commit comments