[Updated] D11549: rust: remove dead code

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Fri Oct 1 16:20:26 UTC 2021


Closed by commit rHG789475ef2b22: rust: remove dead code (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11549?vs=30505&id=30506

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11549/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11549

AFFECTED FILES
  rust/hg-core/src/utils/files.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils/files.rs b/rust/hg-core/src/utils/files.rs
--- a/rust/hg-core/src/utils/files.rs
+++ b/rust/hg-core/src/utils/files.rs
@@ -18,7 +18,6 @@
 use same_file::is_same_file;
 use std::borrow::{Cow, ToOwned};
 use std::ffi::{OsStr, OsString};
-use std::fs::Metadata;
 use std::iter::FusedIterator;
 use std::ops::Deref;
 use std::path::{Path, PathBuf};
@@ -181,38 +180,6 @@
     hfs_ignore_clean(&bytes.to_ascii_lowercase())
 }
 
-#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)]
-pub struct HgMetadata {
-    pub st_dev: u64,
-    pub st_mode: u32,
-    pub st_nlink: u64,
-    pub st_size: u64,
-    pub st_mtime: i64,
-    pub st_ctime: i64,
-}
-
-// TODO support other plaforms
-#[cfg(unix)]
-impl HgMetadata {
-    pub fn from_metadata(metadata: Metadata) -> Self {
-        use std::os::unix::fs::MetadataExt;
-        Self {
-            st_dev: metadata.dev(),
-            st_mode: metadata.mode(),
-            st_nlink: metadata.nlink(),
-            st_size: metadata.size(),
-            st_mtime: metadata.mtime(),
-            st_ctime: metadata.ctime(),
-        }
-    }
-
-    pub fn is_symlink(&self) -> bool {
-        // This is way too manual, but `HgMetadata` will go away in the
-        // near-future dirstate rewrite anyway.
-        self.st_mode & 0170000 == 0120000
-    }
-}
-
 /// Returns the canonical path of `name`, given `cwd` and `root`
 pub fn canonical_path(
     root: impl AsRef<Path>,



To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211001/dcf170cd/attachment-0002.html>


More information about the Mercurial-patches mailing list