diff --git a/src/builder/command.rs b/src/builder/command.rs index 72a68dc4a757..05ab3c740a0e 100644 --- a/src/builder/command.rs +++ b/src/builder/command.rs @@ -4576,9 +4576,7 @@ impl Command { pub(crate) fn write_version_err(&self, use_long: bool) -> StyledStr { let msg = self._render_version(use_long); - let mut styled = StyledStr::new(); - styled.none(msg); - styled + StyledStr::from(msg) } pub(crate) fn long_help_exists(&self) -> bool { diff --git a/src/builder/styled_str.rs b/src/builder/styled_str.rs index da6614901097..c453a4d86b88 100644 --- a/src/builder/styled_str.rs +++ b/src/builder/styled_str.rs @@ -171,9 +171,7 @@ impl Default for &'_ StyledStr { impl From for StyledStr { fn from(name: std::string::String) -> Self { - let mut styled = StyledStr::new(); - styled.none(name); - styled + StyledStr(name) } }