changeset 48082:789475ef2b22

rust: remove dead code Differential Revision: https://phab.mercurial-scm.org/D11549
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 01 Oct 2021 18:14:56 +0200
parents 3da7bf75fdb2
children fecfea658127
files rust/hg-core/src/utils/files.rs
diffstat 1 files changed, 0 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/utils/files.rs	Sat Sep 11 00:09:29 2021 +0200
+++ b/rust/hg-core/src/utils/files.rs	Fri Oct 01 18:14:56 2021 +0200
@@ -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>,