Skip to content

Commit

Permalink
refactor(version): Directly convert rendered to styled
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Mar 17, 2023
1 parent 8f94bea commit cf726c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/builder/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions src/builder/styled_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ impl Default for &'_ StyledStr {

impl From<std::string::String> for StyledStr {
fn from(name: std::string::String) -> Self {
let mut styled = StyledStr::new();
styled.none(name);
styled
StyledStr(name)
}
}

Expand Down

0 comments on commit cf726c9

Please sign in to comment.