Skip to content

Commit 9595bab

Browse files
committed
Fix warning about unused result
1 parent 8c2bde8 commit 9595bab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/spidev-hello.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::io::prelude::*;
44

55
fn main() {
66
let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();
7-
spidev.write(&[0xAA, 0x00, 0x01, 0x02, 0x04]).unwrap();
7+
let wrote = spidev.write(&[0xAA, 0x00, 0x01, 0x02, 0x04]).unwrap();
88

99
let mut buf: [u8; 10] = [0; 10];
10-
spidev.read(&mut buf).unwrap(); // read 10
11-
println!("{:?}", buf);
10+
let read = spidev.read(&mut buf).unwrap(); // read 10
11+
println!("Wrote: {}, Read: {}, Data: {:?}", wrote, read, buf);
1212
}

0 commit comments

Comments
 (0)