parent
45deaa0978
commit
c7c65ef671
1 changed files with 6 additions and 2 deletions
|
@ -102,10 +102,10 @@ impl FormattedStringExt for str {
|
|||
|
||||
impl FormattedStringExt for String {
|
||||
fn is_formatted(&self) -> bool {
|
||||
(&self[..]).is_formatted()
|
||||
self.as_str().is_formatted()
|
||||
}
|
||||
fn strip_formatting(&self) -> Cow<str> {
|
||||
(&self[..]).strip_formatting()
|
||||
self.as_str().strip_formatting()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,10 @@ mod test {
|
|||
fn test_strip_bold() {
|
||||
assert_eq!("l\x02ol".strip_formatting(), "lol");
|
||||
}
|
||||
#[test]
|
||||
fn test_strip_bold_from_string() {
|
||||
assert_eq!(String::from("l\x02ol").strip_formatting(), "lol");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_strip_fg_color() {
|
||||
|
|
Loading…
Add table
Reference in a new issue