Skip to content

Commit 4a0d0fc

Browse files
benschulzgitbot
authored and
gitbot
committed
Improve examples for file locking
1 parent 4fd0696 commit 4a0d0fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

std/src/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ impl File {
664664
/// use std::fs::File;
665665
///
666666
/// fn main() -> std::io::Result<()> {
667-
/// let f = File::open("foo.txt")?;
667+
/// let f = File::create("foo.txt")?;
668668
/// f.lock()?;
669669
/// Ok(())
670670
/// }
@@ -767,7 +767,7 @@ impl File {
767767
/// use std::fs::File;
768768
///
769769
/// fn main() -> std::io::Result<()> {
770-
/// let f = File::open("foo.txt")?;
770+
/// let f = File::create("foo.txt")?;
771771
/// f.try_lock()?;
772772
/// Ok(())
773773
/// }

0 commit comments

Comments
 (0)