mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-10 01:42:49 +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
@ -28,7 +28,7 @@ use crate::content_hash::ContentHash;
|
|||||||
use crate::file_util;
|
use crate::file_util;
|
||||||
|
|
||||||
/// Owned `RepoPath` component.
|
/// Owned `RepoPath` component.
|
||||||
#[derive(ContentHash, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
|
#[derive(ContentHash, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct RepoPathComponentBuf {
|
pub struct RepoPathComponentBuf {
|
||||||
// Don't add more fields. Eq, Hash, and Ord must be compatible with the
|
// Don't add more fields. Eq, Hash, and Ord must be compatible with the
|
||||||
// borrowed RepoPathComponent type.
|
// borrowed RepoPathComponent type.
|
||||||
@ -36,7 +36,7 @@ pub struct RepoPathComponentBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Borrowed `RepoPath` component.
|
/// Borrowed `RepoPath` component.
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Hash, RefCastCustom)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RefCastCustom)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct RepoPathComponent {
|
pub struct RepoPathComponent {
|
||||||
value: str,
|
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 {
|
impl From<&str> for RepoPathComponentBuf {
|
||||||
fn from(value: &str) -> Self {
|
fn from(value: &str) -> Self {
|
||||||
RepoPathComponentBuf::from(value.to_owned())
|
RepoPathComponentBuf::from(value.to_owned())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user