Skip to content

Fix doc comment of File::try_lock and File::try_lock_shared #145046

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 1 commit into from
Aug 8, 2025
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ impl File {
///
/// If this file handle/descriptor, or a clone of it, already holds a lock, the exact behavior
/// is unspecified and platform dependent, including the possibility that it will deadlock.
/// However, if this method returns `Ok(true)`, then it has acquired an exclusive lock.
/// However, if this method returns `Ok(())`, then it has acquired an exclusive lock.
///
/// If the file is not open for writing, it is unspecified whether this function returns an error.
///
Expand Down Expand Up @@ -879,7 +879,7 @@ impl File {
///
/// If this file handle, or a clone of it, already holds a lock, the exact behavior is
/// unspecified and platform dependent, including the possibility that it will deadlock.
/// However, if this method returns `Ok(true)`, then it has acquired a shared lock.
/// However, if this method returns `Ok(())`, then it has acquired a shared lock.
///
/// The lock will be released when this file (along with any other file descriptors/handles
/// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
Expand Down
Loading