Skip to content

Implement I/O-safe traits on types #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code review
  • Loading branch information
notgull committed Apr 30, 2023
commit e1d66f53a2a0e05da27c4417f85b371d2a9070df
10 changes: 4 additions & 6 deletions src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use crate::prelude::*;
use crate::task::{spawn_blocking, Context, Poll, Waker};
use crate::utils::Context as _;

const ARC_TRY_UNWRAP_EXPECT: &str = "cannot acquire ownership of the file handle after drop";

/// An open file on the filesystem.
///
/// Depending on what options the file was opened with, this type can be used for reading and/or
Expand Down Expand Up @@ -413,9 +415,7 @@ impl From<std::fs::File> for File {
}

cfg_unix! {
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};


use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};

impl AsRawFd for File {
fn as_raw_fd(&self) -> RawFd {
Expand Down Expand Up @@ -1027,6 +1027,4 @@ mod tests {
Ok(())
})
}
}

const ARC_TRY_UNWRAP_EXPECT: &str = "cannot acquire ownership of the file handle after drop";
}