diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index 68abae74d..6a8716ddb 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -28,7 +28,7 @@ use crate::content_hash::ContentHash; use crate::file_util; /// Owned `RepoPath` component. -#[derive(ContentHash, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] +#[derive(ContentHash, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RepoPathComponentBuf { // Don't add more fields. Eq, Hash, and Ord must be compatible with the // borrowed RepoPathComponent type. @@ -36,7 +36,7 @@ pub struct RepoPathComponentBuf { } /// Borrowed `RepoPath` component. -#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Hash, RefCastCustom)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RefCastCustom)] #[repr(transparent)] pub struct RepoPathComponent { value: str, @@ -59,6 +59,18 @@ impl RepoPathComponent { } } +impl Debug for RepoPathComponent { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{:?}", &self.value) + } +} + +impl Debug for RepoPathComponentBuf { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + ::fmt(self, f) + } +} + impl From<&str> for RepoPathComponentBuf { fn from(value: &str) -> Self { RepoPathComponentBuf::from(value.to_owned())