diff --git a/stun/src/uri.rs b/stun/src/uri.rs index 5dce476d9..d87a2f833 100644 --- a/stun/src/uri.rs +++ b/stun/src/uri.rs @@ -21,7 +21,7 @@ pub struct Uri { impl fmt::Display for Uri { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let host = if self.host.contains("::") { - "[".to_owned() + self.host.as_str() + "]" + format!("[{}]", self.host) } else { self.host.clone() };