Skip to content

Commit 69f4590

Browse files
committed
Add Debug impl for BackendTarget.
1 parent 39625cc commit 69f4590

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

crates/backend/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ impl fmt::Display for BackendTarget {
9898
}
9999
}
100100

101+
impl fmt::Debug for BackendTarget {
102+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
103+
write!(f, "{}", {
104+
match self {
105+
Self::FileSystem(paths) => format!(
106+
"file:{}",
107+
paths.documents_dir().to_string_lossy()
108+
),
109+
Self::Database(paths, _) => format!(
110+
"sqlite:{}",
111+
paths.documents_dir().to_string_lossy()
112+
),
113+
}
114+
})
115+
}
116+
}
117+
101118
impl BackendTarget {
102119
/// Infer and initialize a new backend target.
103120
///

0 commit comments

Comments
 (0)