@@ -9,7 +9,7 @@ use crate::sys::hermit::abi;
99use crate :: sys:: hermit:: abi:: { O_APPEND , O_CREAT , O_EXCL , O_RDONLY , O_RDWR , O_TRUNC , O_WRONLY } ;
1010use crate :: sys:: hermit:: fd:: FileDesc ;
1111use crate :: sys:: time:: SystemTime ;
12- use crate :: sys:: { unsupported, Void } ;
12+ use crate :: sys:: unsupported;
1313use crate :: sys_common:: os_str_bytes:: OsStrExt ;
1414
1515pub use crate :: sys_common:: fs:: copy;
@@ -22,11 +22,11 @@ fn cstr(path: &Path) -> io::Result<CString> {
2222#[ derive( Debug ) ]
2323pub struct File ( FileDesc ) ;
2424
25- pub struct FileAttr ( Void ) ;
25+ pub struct FileAttr ( ! ) ;
2626
27- pub struct ReadDir ( Void ) ;
27+ pub struct ReadDir ( ! ) ;
2828
29- pub struct DirEntry ( Void ) ;
29+ pub struct DirEntry ( ! ) ;
3030
3131#[ derive( Clone , Debug ) ]
3232pub struct OpenOptions {
@@ -41,146 +41,146 @@ pub struct OpenOptions {
4141 mode : i32 ,
4242}
4343
44- pub struct FilePermissions ( Void ) ;
44+ pub struct FilePermissions ( ! ) ;
4545
46- pub struct FileType ( Void ) ;
46+ pub struct FileType ( ! ) ;
4747
4848#[ derive( Debug ) ]
4949pub struct DirBuilder { }
5050
5151impl FileAttr {
5252 pub fn size ( & self ) -> u64 {
53- match self . 0 { }
53+ self . 0
5454 }
5555
5656 pub fn perm ( & self ) -> FilePermissions {
57- match self . 0 { }
57+ self . 0
5858 }
5959
6060 pub fn file_type ( & self ) -> FileType {
61- match self . 0 { }
61+ self . 0
6262 }
6363
6464 pub fn modified ( & self ) -> io:: Result < SystemTime > {
65- match self . 0 { }
65+ self . 0
6666 }
6767
6868 pub fn accessed ( & self ) -> io:: Result < SystemTime > {
69- match self . 0 { }
69+ self . 0
7070 }
7171
7272 pub fn created ( & self ) -> io:: Result < SystemTime > {
73- match self . 0 { }
73+ self . 0
7474 }
7575}
7676
7777impl Clone for FileAttr {
7878 fn clone ( & self ) -> FileAttr {
79- match self . 0 { }
79+ self . 0
8080 }
8181}
8282
8383impl FilePermissions {
8484 pub fn readonly ( & self ) -> bool {
85- match self . 0 { }
85+ self . 0
8686 }
8787
8888 pub fn set_readonly ( & mut self , _readonly : bool ) {
89- match self . 0 { }
89+ self . 0
9090 }
9191}
9292
9393impl Clone for FilePermissions {
9494 fn clone ( & self ) -> FilePermissions {
95- match self . 0 { }
95+ self . 0
9696 }
9797}
9898
9999impl PartialEq for FilePermissions {
100100 fn eq ( & self , _other : & FilePermissions ) -> bool {
101- match self . 0 { }
101+ self . 0
102102 }
103103}
104104
105105impl Eq for FilePermissions { }
106106
107107impl fmt:: Debug for FilePermissions {
108108 fn fmt ( & self , _f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
109- match self . 0 { }
109+ self . 0
110110 }
111111}
112112
113113impl FileType {
114114 pub fn is_dir ( & self ) -> bool {
115- match self . 0 { }
115+ self . 0
116116 }
117117
118118 pub fn is_file ( & self ) -> bool {
119- match self . 0 { }
119+ self . 0
120120 }
121121
122122 pub fn is_symlink ( & self ) -> bool {
123- match self . 0 { }
123+ self . 0
124124 }
125125}
126126
127127impl Clone for FileType {
128128 fn clone ( & self ) -> FileType {
129- match self . 0 { }
129+ self . 0
130130 }
131131}
132132
133133impl Copy for FileType { }
134134
135135impl PartialEq for FileType {
136136 fn eq ( & self , _other : & FileType ) -> bool {
137- match self . 0 { }
137+ self . 0
138138 }
139139}
140140
141141impl Eq for FileType { }
142142
143143impl Hash for FileType {
144144 fn hash < H : Hasher > ( & self , _h : & mut H ) {
145- match self . 0 { }
145+ self . 0
146146 }
147147}
148148
149149impl fmt:: Debug for FileType {
150150 fn fmt ( & self , _f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
151- match self . 0 { }
151+ self . 0
152152 }
153153}
154154
155155impl fmt:: Debug for ReadDir {
156156 fn fmt ( & self , _f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
157- match self . 0 { }
157+ self . 0
158158 }
159159}
160160
161161impl Iterator for ReadDir {
162162 type Item = io:: Result < DirEntry > ;
163163
164164 fn next ( & mut self ) -> Option < io:: Result < DirEntry > > {
165- match self . 0 { }
165+ self . 0
166166 }
167167}
168168
169169impl DirEntry {
170170 pub fn path ( & self ) -> PathBuf {
171- match self . 0 { }
171+ self . 0
172172 }
173173
174174 pub fn file_name ( & self ) -> OsString {
175- match self . 0 { }
175+ self . 0
176176 }
177177
178178 pub fn metadata ( & self ) -> io:: Result < FileAttr > {
179- match self . 0 { }
179+ self . 0
180180 }
181181
182182 pub fn file_type ( & self ) -> io:: Result < FileType > {
183- match self . 0 { }
183+ self . 0
184184 }
185185}
186186
0 commit comments