diff --git a/Cargo.toml b/Cargo.toml index 4546b59..4d76e79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/src/types/misc/sshurl.rs b/src/types/misc/sshurl.rs index c6bd207..9b24cec 100644 --- a/src/types/misc/sshurl.rs +++ b/src/types/misc/sshurl.rs @@ -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;