diff rust/hg-cpython/src/vfs.rs @ 52180:735bf027dd1d

rust-vfs: add tests to `AtomicFile` This also makes it more usable from Rust by separating `from_file` and `new`.
author Rapha?l Gom?s <rgomes@octobus.net>
date Tue, 08 Oct 2024 16:10:30 +0200
parents 72bc29f01570
children 8d35941689af
line wrap: on
line diff
--- a/rust/hg-cpython/src/vfs.rs	Tue Oct 08 16:09:39 2024 +0200
+++ b/rust/hg-cpython/src/vfs.rs	Tue Oct 08 16:10:30 2024 +0200
@@ -170,7 +170,7 @@
     ) -> Result<hg::vfs::AtomicFile, HgError> {
         self.inner_open(filename, true, false, true, true).map(
             |(fp, temp_name)| {
-                hg::vfs::AtomicFile::new(
+                hg::vfs::AtomicFile::from_file(
                     fp,
                     check_ambig,
                     temp_name.expect("temp name should exist"),