Skip to content

Commit

Permalink
Fix FileSystem::write docstring (#150)
Browse files Browse the repository at this point in the history
It does not make sense to create a file when it exists.
I guess it must be the opposite, create it when it does *not* exist.
  • Loading branch information
LordPatate authored Aug 15, 2024
1 parent 1140aa2 commit 487cbdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/filesystem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ pub trait FileSystem: Send + Sync {
}

/// Corresponds to [`std::fs::write()`].
/// Will open a file at the path, create it if it exists (and truncate it) and then write the provided bytes.
/// Will open a file at the path, create it if it does not exist (and truncate it)
/// and then write the provided bytes.
fn write(&self, path: impl AsRef<camino::Utf8Path>, data: impl AsRef<[u8]>) -> Result<()> {
use std::io::Write;

Expand Down

0 comments on commit 487cbdf

Please sign in to comment.