@@ -18,43 +18,43 @@ pub(crate) enum Descriptor {
1818
1919impl From < OsHandle > for Descriptor {
2020 fn from ( handle : OsHandle ) -> Self {
21- Descriptor :: OsHandle ( handle)
21+ Self :: OsHandle ( handle)
2222 }
2323}
2424
2525impl From < Box < dyn VirtualFile > > for Descriptor {
2626 fn from ( virt : Box < dyn VirtualFile > ) -> Self {
27- Descriptor :: VirtualFile ( virt)
27+ Self :: VirtualFile ( virt)
2828 }
2929}
3030
3131impl fmt:: Debug for Descriptor {
3232 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
3333 match self {
34- Descriptor :: OsHandle ( handle) => write ! ( f, "{:?}" , handle) ,
35- Descriptor :: VirtualFile ( _) => write ! ( f, "VirtualFile" ) ,
36- Descriptor :: Stdin => write ! ( f, "Stdin" ) ,
37- Descriptor :: Stdout => write ! ( f, "Stdout" ) ,
38- Descriptor :: Stderr => write ! ( f, "Stderr" ) ,
34+ Self :: OsHandle ( handle) => write ! ( f, "{:?}" , handle) ,
35+ Self :: VirtualFile ( _) => write ! ( f, "VirtualFile" ) ,
36+ Self :: Stdin => write ! ( f, "Stdin" ) ,
37+ Self :: Stdout => write ! ( f, "Stdout" ) ,
38+ Self :: Stderr => write ! ( f, "Stderr" ) ,
3939 }
4040 }
4141}
4242
4343impl Descriptor {
44- pub ( crate ) fn try_clone ( & self ) -> io:: Result < Descriptor > {
44+ pub ( crate ) fn try_clone ( & self ) -> io:: Result < Self > {
4545 match self {
46- Descriptor :: OsHandle ( file) => file. try_clone ( ) . map ( |f| OsHandle :: from ( f) . into ( ) ) ,
47- Descriptor :: VirtualFile ( virt) => virt. try_clone ( ) . map ( Descriptor :: VirtualFile ) ,
48- Descriptor :: Stdin => Ok ( Descriptor :: Stdin ) ,
49- Descriptor :: Stdout => Ok ( Descriptor :: Stdout ) ,
50- Descriptor :: Stderr => Ok ( Descriptor :: Stderr ) ,
46+ Self :: OsHandle ( file) => file. try_clone ( ) . map ( |f| OsHandle :: from ( f) . into ( ) ) ,
47+ Self :: VirtualFile ( virt) => virt. try_clone ( ) . map ( Self :: VirtualFile ) ,
48+ Self :: Stdin => Ok ( Self :: Stdin ) ,
49+ Self :: Stdout => Ok ( Self :: Stdout ) ,
50+ Self :: Stderr => Ok ( Self :: Stderr ) ,
5151 }
5252 }
5353
5454 /// Return a reference to the `OsHandle` or `VirtualFile` treating it as an
5555 /// actual file/dir, and allowing operations which require an actual file and
5656 /// not just a stream or socket file descriptor.
57- pub ( crate ) fn as_file < ' descriptor > ( & ' descriptor self ) -> WasiResult < & ' descriptor Descriptor > {
57+ pub ( crate ) fn as_file < ' descriptor > ( & ' descriptor self ) -> WasiResult < & ' descriptor Self > {
5858 match self {
5959 Self :: OsHandle ( _) => Ok ( self ) ,
6060 Self :: VirtualFile ( _) => Ok ( self ) ,
@@ -65,7 +65,7 @@ impl Descriptor {
6565 /// Like `as_file`, but return a mutable reference.
6666 pub ( crate ) fn as_file_mut < ' descriptor > (
6767 & ' descriptor mut self ,
68- ) -> WasiResult < & ' descriptor mut Descriptor > {
68+ ) -> WasiResult < & ' descriptor mut Self > {
6969 match self {
7070 Self :: OsHandle ( _) => Ok ( self ) ,
7171 Self :: VirtualFile ( _) => Ok ( self ) ,
0 commit comments