Skip to content

Commit f583724

Browse files
committed
Adds doc comments
1 parent 72f12cf commit f583724

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/leds.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pub enum Direction
2222
}
2323

2424
impl Direction {
25+
/// Provides an iterator starting with North
26+
/// and moving clockwise around the compass
27+
/// e.g. N -> NE -> E, etc.
2528
pub fn iter() -> Iter<'static, Direction> {
2629
static DIRECTIONS: [Direction; 8] = [
2730
Direction::North,
@@ -128,6 +131,9 @@ impl Leds {
128131
}
129132
}
130133

134+
/// Provides a mutable iterator for iterating over the on board leds.
135+
/// Starts at ld3 (N) and moves clockwise.
136+
/// Stops once it has iterated through all 8 leds.
131137
pub fn iter_mut(&mut self) -> LedsMutIterator {
132138
LedsMutIterator::new(self)
133139
}

0 commit comments

Comments
 (0)