File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed
Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ exclude = [
1616[dependencies ]
1717# Private dependencies.
1818libc = " 0.2"
19- # Public dependencies, exposed through library API.
20- either = " 1.5"
2119
2220[package .metadata .release ]
2321sign-commit = true
Original file line number Diff line number Diff line change @@ -172,11 +172,8 @@ impl Memfd {
172172 /// Otherwise the supplied `File` is returned for further usage.
173173 ///
174174 /// [`File`]: fs::File
175- pub fn try_from_file ( file : fs:: File ) -> either:: Either < Self , fs:: File > {
176- match Self :: try_from_fd ( file) {
177- Ok ( x) => either:: Either :: Left ( x) ,
178- Err ( e) => either:: Either :: Right ( e) ,
179- }
175+ pub fn try_from_file ( file : fs:: File ) -> Result < Self , fs:: File > {
176+ Self :: try_from_fd ( file)
180177 }
181178
182179 /// Return a reference to the backing [`File`].
Original file line number Diff line number Diff line change @@ -42,13 +42,11 @@ fn test_memfd_from_into() {
4242 let m0 = opts. create ( "default" ) . unwrap ( ) ;
4343 let f0 = m0. into_file ( ) ;
4444 let _ = memfd:: Memfd :: try_from_file ( f0)
45- . left ( )
4645 . expect ( "failed to convert a legit memfd file" ) ;
4746
4847 let rootdir = fs:: File :: open ( "/" ) . unwrap ( ) ;
4948 let _ = memfd:: Memfd :: try_from_file ( rootdir)
50- . right ( )
51- . expect ( "unexpected conversion from a non-memfd file" ) ;
49+ . expect_err ( "unexpected conversion from a non-memfd file" ) ;
5250}
5351
5452/// Check if the close-on-exec flag is set for the memfd.
You can’t perform that action at this time.
0 commit comments