Skip to content

Commit

Permalink
Fix doc warnings for cargo-util::paths
Browse files Browse the repository at this point in the history
Add parentheses to disambiguate from `write!`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
  • Loading branch information
PaulDance committed May 9, 2021
1 parent 2daf97c commit 9ea1cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/cargo-util/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
.with_context(|| format!("failed to write `{}`", path.display()))
}

/// Equivalent to [`write`], but does not write anything if the file contents
/// Equivalent to [`write()`], but does not write anything if the file contents
/// are identical to the given contents.
pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()> {
(|| -> Result<()> {
Expand All @@ -184,7 +184,7 @@ pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) ->
Ok(())
}

/// Equivalent to [`write`], but appends to the end instead of replacing the
/// Equivalent to [`write()`], but appends to the end instead of replacing the
/// contents.
pub fn append(path: &Path, contents: &[u8]) -> Result<()> {
(|| -> Result<()> {
Expand Down

0 comments on commit 9ea1cbd

Please sign in to comment.