File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,10 @@ extern crate tokio;
51
51
52
52
use std:: fs;
53
53
use std:: fs:: File ;
54
+ use std:: io;
54
55
use std:: io:: prelude:: * ;
55
- use std:: io:: { self , SeekFrom } ;
56
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
57
+ use std:: io:: SeekFrom ;
56
58
use std:: os:: unix:: prelude:: * ;
57
59
use std:: path:: Path ;
58
60
@@ -113,12 +115,14 @@ pub type Result<T> = ::std::result::Result<T, error::Error>;
113
115
/// Typically, one would just use seek() for this sort of thing,
114
116
/// but for certain files (e.g. in sysfs), you need to actually
115
117
/// read it.
118
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
116
119
fn flush_input_from_file ( dev_file : & mut File , max : usize ) -> io:: Result < usize > {
117
120
let mut s = String :: with_capacity ( max) ;
118
121
dev_file. read_to_string ( & mut s)
119
122
}
120
123
121
124
/// Get the pin value from the provided file
125
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
122
126
fn get_value_from_file ( dev_file : & mut File ) -> Result < u8 > {
123
127
let mut s = String :: with_capacity ( 10 ) ;
124
128
dev_file. seek ( SeekFrom :: Start ( 0 ) ) ?;
You can’t perform that action at this time.
0 commit comments