Skip to content

Commit d9a86ff

Browse files
committed
Fix remaining unused warnings using conditional compilation.
1 parent 5144590 commit d9a86ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ extern crate tokio;
5151

5252
use std::fs;
5353
use std::fs::File;
54+
use std::io;
5455
use std::io::prelude::*;
55-
use std::io::{self, SeekFrom};
56+
#[cfg(any(target_os = "linux", target_os = "android"))]
57+
use std::io::SeekFrom;
5658
use std::os::unix::prelude::*;
5759
use std::path::Path;
5860

@@ -113,12 +115,14 @@ pub type Result<T> = ::std::result::Result<T, error::Error>;
113115
/// Typically, one would just use seek() for this sort of thing,
114116
/// but for certain files (e.g. in sysfs), you need to actually
115117
/// read it.
118+
#[cfg(any(target_os = "linux", target_os = "android"))]
116119
fn flush_input_from_file(dev_file: &mut File, max: usize) -> io::Result<usize> {
117120
let mut s = String::with_capacity(max);
118121
dev_file.read_to_string(&mut s)
119122
}
120123

121124
/// Get the pin value from the provided file
125+
#[cfg(any(target_os = "linux", target_os = "android"))]
122126
fn get_value_from_file(dev_file: &mut File) -> Result<u8> {
123127
let mut s = String::with_capacity(10);
124128
dev_file.seek(SeekFrom::Start(0))?;

0 commit comments

Comments
 (0)