feat: implement Display for SshUrl
This commit is contained in:
parent
f97eb735fb
commit
030de8f9f8
2 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "forgejo-api-types"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
keywords = ["forgejo", "types", "codeberg", "api"]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use std::fmt::Display;
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::de::{Deserializer, Error, Visitor};
|
||||
|
@ -11,6 +12,12 @@ pub struct SshUrl {
|
|||
url: Url,
|
||||
}
|
||||
|
||||
impl Display for SshUrl {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}@{}", self.prefix, self.url)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for SshUrl {
|
||||
type Err = String;
|
||||
|
||||
|
|
Loading…
Reference in a new issue