Skip to content

Commit

Permalink
Improve examples for file locking
Browse files Browse the repository at this point in the history
  • Loading branch information
benschulz authored and gitbot committed Feb 22, 2025
1 parent 1964abf commit d842901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl File {
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let f = File::open("foo.txt")?;
/// let f = File::create("foo.txt")?;
/// f.lock()?;
/// Ok(())
/// }
Expand Down Expand Up @@ -767,7 +767,7 @@ impl File {
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let f = File::open("foo.txt")?;
/// let f = File::create("foo.txt")?;
/// f.try_lock()?;
/// Ok(())
/// }
Expand Down

0 comments on commit d842901

Please sign in to comment.