diff --git a/clap_builder/src/builder/styled_str.rs b/clap_builder/src/builder/styled_str.rs index 2b08bf42bea..c8d2c92203d 100644 --- a/clap_builder/src/builder/styled_str.rs +++ b/clap_builder/src/builder/styled_str.rs @@ -1,5 +1,7 @@ #![cfg_attr(not(feature = "usage"), allow(dead_code))] +use std::borrow::Cow; + /// Terminal-styling container /// /// Styling may be encoded as [ANSI Escape Code](https://en.wikipedia.org/wiki/ANSI_escape_code) @@ -208,3 +210,9 @@ impl std::fmt::Display for StyledStr { Ok(()) } } + +impl From> for StyledStr { + fn from(value: Cow<'static, str>) -> Self { + StyledStr(value.to_string()) + } +}