You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggesting this because, while it doesn't necessarily look as nice, it should avoid (some of) the unnecessary allocations from building a `Vec<String>` for printing purposes.
write!(f, "{}", self.name)?;
if !key_value_pairs.is_empty() {
write!(f, "(")?;
for (i, (k, v)) in key_value_pairs.iter().enumerate() {
if i > 0 { write!(f, ", ")? }
write!(f, "{}: {}", k, v)?;
}
write!(f, ")")?;
}
Ok(())
}
}
Originally posted by @Shadow53 in #138 (comment)
The text was updated successfully, but these errors were encountered: