Skip to content

Commit

Permalink
Add Into impl for std::fs::File
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor authored and andrewhickman committed Feb 19, 2022
1 parent deafb99 commit 378d580
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ impl<'a> Read for &'a File {
}
}

impl From<File> for fs::File {
fn from(file: File) -> Self {
file.into_parts().0
}
}

impl Seek for File {
fn seek(&mut self, pos: std::io::SeekFrom) -> std::io::Result<u64> {
self.file
Expand Down

0 comments on commit 378d580

Please sign in to comment.