We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c477616 commit ae82166Copy full SHA for ae82166
crates/xdid-core/src/did.rs
@@ -1,10 +1,13 @@
1
-use std::{fmt::Display, str::FromStr};
+use std::{
2
+ fmt::{Debug, Display},
3
+ str::FromStr,
4
+};
5
6
use anyhow::bail;
7
use serde::{Deserialize, Serialize};
8
use smol_str::SmolStr;
9
-#[derive(Debug, Clone, PartialEq, Eq)]
10
+#[derive(Clone, PartialEq, Eq)]
11
/// A [Decentralized Identifier](https://www.w3.org/TR/did-core/#did-syntax).
12
pub struct Did {
13
pub method_name: MethodName,
@@ -17,6 +20,12 @@ impl Display for Did {
17
20
}
18
21
19
22
23
+impl Debug for Did {
24
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25
+ write!(f, "did:{}:{}", self.method_name.0, self.method_id.0)
26
+ }
27
+}
28
+
29
impl FromStr for Did {
30
type Err = anyhow::Error;
31
0 commit comments