File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ pub trait WordCountable: AsFd + AsRawFd + Read {
2424pub trait WordCountable : Read {
2525 type Buffered : BufRead ;
2626 fn buffered ( self ) -> Self :: Buffered ;
27+ #[ cfg( not( target_os = "wasi" ) ) ]
2728 fn inner_file ( & mut self ) -> Option < & mut File > ;
2829}
2930
@@ -33,6 +34,8 @@ impl WordCountable for StdinLock<'_> {
3334 fn buffered ( self ) -> Self :: Buffered {
3435 self
3536 }
37+
38+ #[ cfg( not( target_os = "wasi" ) ) ]
3639 fn inner_file ( & mut self ) -> Option < & mut File > {
3740 None
3841 }
@@ -45,6 +48,7 @@ impl WordCountable for File {
4548 BufReader :: new ( self )
4649 }
4750
51+ #[ cfg( not( target_os = "wasi" ) ) ]
4852 fn inner_file ( & mut self ) -> Option < & mut File > {
4953 Some ( self )
5054 }
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ pub struct FileInformation(
4646 #[ cfg( unix) ] nix:: sys:: stat:: FileStat ,
4747 #[ cfg( windows) ] winapi_util:: file:: Information ,
4848 // WASI does not have nix::sys::stat, so we store std::fs::Metadata instead.
49- #[ cfg( target_os = "wasi" ) ] std :: fs:: Metadata ,
49+ #[ cfg( target_os = "wasi" ) ] fs:: Metadata ,
5050) ;
5151
5252impl FileInformation {
@@ -97,9 +97,9 @@ impl FileInformation {
9797 #[ cfg( target_os = "wasi" ) ]
9898 {
9999 let metadata = if dereference {
100- std :: fs:: metadata ( path. as_ref ( ) )
100+ fs:: metadata ( path. as_ref ( ) )
101101 } else {
102- std :: fs:: symlink_metadata ( path. as_ref ( ) )
102+ fs:: symlink_metadata ( path. as_ref ( ) )
103103 } ;
104104 Ok ( Self ( metadata?) )
105105 }
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ use crate::os_str_from_bytes;
2828#[ cfg( windows) ]
2929use crate :: show_warning;
3030
31+ #[ cfg( not( target_os = "wasi" ) ) ]
3132use std:: ffi:: OsStr ;
3233#[ cfg( unix) ]
3334use std:: os:: unix:: ffi:: OsStrExt ;
@@ -64,13 +65,14 @@ use libc::{
6465} ;
6566#[ cfg( unix) ]
6667use std:: ffi:: { CStr , CString } ;
68+ #[ cfg( not( target_os = "wasi" ) ) ]
6769use std:: io:: Error as IOError ;
6870#[ cfg( unix) ]
6971use std:: mem;
7072#[ cfg( windows) ]
7173use std:: path:: Path ;
7274use std:: time:: SystemTime ;
73- #[ cfg( not ( windows ) ) ]
75+ #[ cfg( unix ) ]
7476use std:: time:: UNIX_EPOCH ;
7577use std:: { borrow:: Cow , ffi:: OsString } ;
7678
You can’t perform that action at this time.
0 commit comments