mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
2996cfdcc3
Improve examples for file locking The `lock` and `try_lock` documentation states that "if the file not open for writing, it is unspecified whether this function returns an error." With this change, the examples use `File::create` instead of `File::open`, eliminating the possibility of someone blindly copying code with unspecified behavior.