diff --git a/src/lib.rs b/src/lib.rs index 5ced4003..3f39cbcf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,7 @@ impl FromStr for Jid { fn from_str(s: &str) -> Result { // TODO: very naive, may need to do it differently let iter = s.chars(); - let mut buf = String::new(); + let mut buf = String::with_capacity(s.len()); let mut state = ParserState::Node; let mut node = None; let mut domain = None;