diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-18 16:08:34 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-18 16:08:34 +0100 |
| commit | 70169924b611b9b68587bd9169f991e3770b7dc7 (patch) | |
| tree | 83268ed2da5526d50ef111f8d7217b908221da6d /common/object | |
| parent | 45a485431df0638396f0175de59275b3b5538022 (diff) | |
| download | jellything-70169924b611b9b68587bd9169f991e3770b7dc7.tar jellything-70169924b611b9b68587bd9169f991e3770b7dc7.tar.bz2 jellything-70169924b611b9b68587bd9169f991e3770b7dc7.tar.zst | |
show database debug info
Diffstat (limited to 'common/object')
| -rw-r--r-- | common/object/src/path.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/common/object/src/path.rs b/common/object/src/path.rs index fc14e6d..0751ff0 100644 --- a/common/object/src/path.rs +++ b/common/object/src/path.rs @@ -5,7 +5,7 @@ */ use crate::{Object, Tag, TypedTag}; -use std::marker::PhantomData; +use std::{fmt::Display, marker::PhantomData}; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Path(pub Vec<Tag>); @@ -36,3 +36,15 @@ impl Path { out } } + +impl Display for Path { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + for (i, c) in self.0.iter().enumerate() { + if i > 0 { + write!(f, ".")?; + } + write!(f, "{c}")?; + } + Ok(()) + } +} |