File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ impl<'s> Escape<'s> {
88 }
99
1010 pub ( crate ) fn to_cow ( self ) -> Cow < ' s , str > {
11- if self . 0 . contains ( char:: is_whitespace) {
11+ if self . 0 . is_empty ( ) || self . 0 . contains ( char:: is_whitespace) {
1212 Cow :: Owned ( format ! ( "{:?}" , self . 0 ) )
1313 } else {
1414 Cow :: Borrowed ( self . 0 )
@@ -18,7 +18,7 @@ impl<'s> Escape<'s> {
1818
1919impl std:: fmt:: Display for Escape < ' _ > {
2020 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
21- if self . 0 . contains ( char:: is_whitespace) {
21+ if self . 0 . is_empty ( ) || self . 0 . contains ( char:: is_whitespace) {
2222 std:: fmt:: Debug :: fmt ( self . 0 , f)
2323 } else {
2424 self . 0 . fmt ( f)
Original file line number Diff line number Diff line change @@ -2044,7 +2044,7 @@ fn empty_default_value() {
20442044Usage: default [OPTIONS]
20452045
20462046Options:
2047- --arg <argument> Pass an argument to the program. [default: ]
2047+ --arg <argument> Pass an argument to the program. [default: "" ]
20482048 -h, --help Print help
20492049 -V, --version Print version
20502050
You can’t perform that action at this time.
0 commit comments