mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
refactor(version): Directly convert rendered to styled
This commit is contained in:
parent
6255229a9c
commit
9516fd928f
2 changed files with 2 additions and 6 deletions
|
@ -4673,9 +4673,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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue