blob: a56cad4efd4b37e03019adaef0010ba239027b22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use std::{fmt::Display, str::FromStr};
#[derive(Debug, Clone)]
pub struct Uri {
pub content: String,
}
impl Display for Uri {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.content)?;
Ok(())
}
}
impl FromStr for Uri {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self {
content: s.to_string(),
})
}
}
|