mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
repo_path: make Debug formatting of RepoPathComponent less verbose
Since RepoPath is formatted as a string, it should be okay for RepoPathComponent to do the same.
This commit is contained in:
parent
1134dc159e
commit
f3485c9efb
1 changed files with 14 additions and 2 deletions
|
@ -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 {
|
||||
<RepoPathComponent as Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for RepoPathComponentBuf {
|
||||
fn from(value: &str) -> Self {
|
||||
RepoPathComponentBuf::from(value.to_owned())
|
||||
|
|
Loading…
Reference in a new issue