Skip to content

Commit c0e8b66

Browse files
committed
Derive default for SA0 enum
1 parent 4a62f09 commit c0e8b66

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,15 @@ pub mod registers;
1818
pub use registers::*;
1919

2020
/// SA0 pin logic level representation.
21+
#[derive(Default)]
2122
pub enum SA0 {
23+
#[default]
2224
/// SA0 tied to GND (default).
2325
Gnd,
2426
/// SA0 tied to V+.
2527
Vplus,
2628
}
2729

28-
impl Default for SA0 {
29-
fn default() -> Self {
30-
Self::Gnd
31-
}
32-
}
33-
3430
impl From<SA0> for u8 {
3531
fn from(connection: SA0) -> Self {
3632
match connection {

0 commit comments

Comments
 (0)