File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/cargo/ops/tree/format Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ impl<'a> Parser<'a> {
79
79
fn text ( & mut self , start : usize ) -> RawChunk < ' a > {
80
80
while let Some ( & ( pos, ch) ) = self . it . peek ( ) {
81
81
match ch {
82
- '{' | '}' | ')' => return RawChunk :: Text ( & self . s [ start..pos] ) ,
82
+ '{' | '}' => return RawChunk :: Text ( & self . s [ start..pos] ) ,
83
83
_ => {
84
84
self . it . next ( ) ;
85
85
}
@@ -110,7 +110,11 @@ impl<'a> Iterator for Parser<'a> {
110
110
}
111
111
Some ( & ( _, '}' ) ) => {
112
112
self . it . next ( ) ;
113
- Some ( RawChunk :: Error ( "unexpected '}'" ) )
113
+ if self . consume ( '}' ) {
114
+ Some ( RawChunk :: Text ( "}" ) )
115
+ } else {
116
+ Some ( RawChunk :: Error ( "unexpected '}'" ) )
117
+ }
114
118
}
115
119
Some ( & ( i, _) ) => Some ( self . text ( i) ) ,
116
120
None => None ,
Original file line number Diff line number Diff line change @@ -903,6 +903,10 @@ Caused by:
903
903
. with_status ( 101 )
904
904
. run ( ) ;
905
905
906
+ p. cargo ( "tree --format {p}-{{hello}}" )
907
+ . with_stdout ( "foo v0.1.0 ([..]/foo)-{hello}" )
908
+ . run ( ) ;
909
+
906
910
p. cargo ( "tree --format" )
907
911
. arg ( "{p} {l} {r}" )
908
912
. with_stdout ( "foo v0.1.0 ([..]/foo) MIT https://github.com/rust-lang/cargo" )
You can’t perform that action at this time.
0 commit comments