Patchwork D11549: rust: remove dead code

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2021, 4:17 p.m.
Message ID <differential-rev-PHID-DREV-vjqtsmduuelzmtkalxlr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49873/
State Superseded
Headers show

Comments

phabricator - Oct. 1, 2021, 4:17 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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>,