Skip to content

Commit 3a21071

Browse files
Improve the module documentation and fix typos
1 parent 400e057 commit 3a21071

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/lib.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,19 @@
108108
//! rename("/path/to/directory/.filename.XXXXXX", "/path/to/directory/filename");
109109
//! ```
110110
//!
111-
//! This Linux-specific behavior is enabled using the `unnamed-tmpfile` feature, which is enabled
112-
//! by default.
111+
//! This Linux-specific behavior is controlled by the `unnamed-tmpfile` feature of this Crate,
112+
//! which is enabled by default.
113113
//!
114114
//! ## Notes and Limitations
115115
//!
116116
//! * If the path of an [`AtomicWriteFile`] is a directory or a file that cannot be removed (due to
117-
//! permissions or special attributes), an error will be produce when the [`AtomicWriteFile`] is
117+
//! permissions or special attributes), an error will be produced when the [`AtomicWriteFile`] is
118118
//! committed. This is in contrast with the standard `File`, which would instead produce an error
119119
//! at `open()` time.
120120
//!
121121
//! * [`AtomicWriteFile`] is designed so that the temporary files it creates are automatically
122122
//! removed if an error (such as a panic) occurs. However, if the process is interrupted abruptly
123-
//! (without unwinding or running destructors), temporary files may be left in the filesystem.
123+
//! (without unwinding or running destructors), temporary files may be left on the filesystem.
124124
//!
125125
//! * On Linux, with the `unnamed-tmpfile` feature (enabled by default), [`AtomicWriteFile`] uses
126126
//! unnamed temporary files. This ensures that, if the process is interrupted abruptly *before* a
@@ -131,22 +131,21 @@
131131
//! * On Linux, with the `unnamed-tmpfile` feature (enabled by default), [`AtomicWriteFile`]
132132
//! requires the `/proc` filesystem to be mounted. This makes [`AtomicWriteFile`] unsuitable for
133133
//! use in processes that run early at boot. Disable the `unnamed-tmpfile` feature if you need to
134-
//! run on
134+
//! run your program in situations where `/proc` is not available.
135135
//!
136136
//! * If the path of an [`AtomicWriteFile`] is a symlink to another file, the symlink is replaced,
137-
//! the target of the original symlink is left untouched.
138-
//!
139-
//! If you intend to modify the file pointed by a symlink at open time, call
140-
//! [`Path::canonicalize()`] prior to calling [`AtomicWriteFile::open()`] or
141-
//! [`OpenOptions::open()`]. In the future, handling of symlinks will be better customizable.
137+
//! and the target of the original symlink is left untouched. If you intend to modify the file
138+
//! pointed by a symlink at open time, call [`Path::canonicalize()`] prior to calling
139+
//! [`AtomicWriteFile::open()`] or [`OpenOptions::open()`]. In the future, handling of symlinks
140+
//! will be better customizable.
142141
//!
143142
//! * Because [`AtomicWriteFile`] works by creating a temporary file, and then replacing the
144143
//! original file (see ["how it works"](#how-it-works) above), some metadata of the original file
145144
//! may be lost:
146145
//!
147146
//! * On Unix, it is possible to preserve permissions and ownership of the original file.
148147
//! However, it is not generally possible to preserve the same owner user/group of the original
149-
//! file unless the process runs as root, or with the `CAP_CHOWN` capability on Linux. See
148+
//! file unless the process runs as root (or with the `CAP_CHOWN` capability on Linux). See
150149
//! [`OpenOptionsExt::try_preserve_owner()`](crate::unix::OpenOptionsExt::try_preserve_owner)
151150
//! for more details on the behavior of [`open()`](OpenOptions::open) when ownership cannot be
152151
//! preserved.

0 commit comments

Comments
 (0)