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;
5151
5252use std:: fs;
5353use std:: fs:: File ;
54+ use std:: io;
5455use std:: io:: prelude:: * ;
55- use std:: io:: { self , SeekFrom } ;
56+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
57+ use std:: io:: SeekFrom ;
5658use std:: os:: unix:: prelude:: * ;
5759use 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" ) ) ]
116119fn 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" ) ) ]
122126fn 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 ) ) ?;
You can’t perform that action at this time.
0 commit comments