diff rust/hg-core/src/dirstate_tree/status.rs @ 48202:0cc0c0972164

dirstate-v2: Only convert from SystemTime to Timestamp and not back Converting from Timestamp back to SystemTime was only used for equality comparison, but this can also be done on Timestamp values. Differential Revision: https://phab.mercurial-scm.org/D11631
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 12 Oct 2021 15:29:05 +0200
parents 1b2ee68e85f9
children d2f760c2c91c
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/status.rs	Fri Oct 08 12:57:24 2021 +0200
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Tue Oct 12 15:29:05 2021 +0200
@@ -199,7 +199,8 @@
                 // directory eligible for `read_dir` caching.
                 if let Some(meta) = directory_metadata {
                     if let Ok(current_mtime) = meta.modified() {
-                        if current_mtime == cached_mtime.into() {
+                        let current_mtime = Timestamp::from(current_mtime);
+                        if current_mtime == *cached_mtime {
                             // The mtime of that directory has not changed
                             // since then, which means that the results of
                             // `read_dir` should also be unchanged.