Skip to content

Commit 8789ce2

Browse files
committed
Change SpiDev::open to SPIError
1 parent 6facf7c commit 8789ce2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/spi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ impl Spidev {
1616
/// See [`spidev::Spidev::open`][0] for details.
1717
///
1818
/// [0]: https://docs.rs/spidev/0.5.0/spidev/struct.Spidev.html#method.open
19-
pub fn open<P>(path: P) -> io::Result<Self>
19+
pub fn open<P>(path: P) -> Result<Self, SPIError>
2020
where
2121
P: AsRef<Path>,
2222
{
23-
spidev::Spidev::open(path).map(Spidev)
23+
spidev::Spidev::open(path).map(Spidev).map_err(|e| e.into())
2424
}
2525
}
2626

0 commit comments

Comments
 (0)