Mercurial > hg
diff rust/hg-core/src/revlog/mod.rs @ 52298:645d247d4c75
rust-vfs: rename `open` to `open_write` and `open_read` to `open`
`open` being read *and* write is surprising because it differs from the
Rust stdlib where `std::fs::File::open` is read-only by default.
More importantly, writing is more dangerous than reading, so let's make it
more explicit.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 29 Oct 2024 12:03:55 +0100 |
parents | a3fa37bdb7ec |
children |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/mod.rs Tue Oct 29 11:41:27 2024 +0100 +++ b/rust/hg-core/src/revlog/mod.rs Tue Oct 29 12:03:55 2024 +0100 @@ -494,7 +494,7 @@ index_path: &Path, options: RevlogOpenOptions, ) -> Result<Index, HgError> { - let buf: IndexData = match store_vfs.open_read(index_path) { + let buf: IndexData = match store_vfs.open(index_path) { Ok(mut file) => { let mut buf = if let Some(threshold) = options.data_config.mmap_index_threshold