Skip to content

Commit f3e9eda

Browse files
hnezEmantor
authored andcommitted
digial_io: gpio: make find_line match hardware.rs behaviour
The find_line in hardware.rs returns an Option<_> match that in demo_mode.rs and test.rs. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent 7794446 commit f3e9eda

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/digital_io/gpio/demo_mode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl FindDecoy {
8181
}
8282
}
8383

84-
pub fn find_line(name: &str) -> Result<FindDecoy> {
85-
Ok(FindDecoy {
84+
pub fn find_line(name: &str) -> Option<FindDecoy> {
85+
Some(FindDecoy {
8686
name: name.to_string(),
8787
})
8888
}

src/digital_io/gpio/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl FindDecoy {
8888
}
8989
}
9090

91-
pub fn find_line(name: &str) -> Result<FindDecoy> {
91+
pub fn find_line(name: &str) -> Option<FindDecoy> {
9292
let val = {
9393
let mut lines = block_on(LINES.lock());
9494

@@ -101,7 +101,7 @@ pub fn find_line(name: &str) -> Result<FindDecoy> {
101101
}
102102
};
103103

104-
Ok(FindDecoy {
104+
Some(FindDecoy {
105105
name: name.to_string(),
106106
val,
107107
})

0 commit comments

Comments
 (0)