Skip to content

Commit 278ed35

Browse files
committed
Assign values to Dir variants
This is very useful, when making step calculations that include the direction as the sign.
1 parent cb79b9d commit 278ed35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ pub enum Dir {
7979
///
8080
/// This corresponds to whatever direction the motor rotates in when the
8181
/// dir signal is set HIGH.
82-
Forward,
82+
Forward = 1,
8383

8484
/// Rotate the motor backward
8585
///
8686
/// This corresponds to whatever direction the motor rotates in when the
8787
/// dir signal set is LOW.
88-
Backward,
88+
Backward = -1,
8989
}

0 commit comments

Comments
 (0)