File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/bootstrap/src/core/builder Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1839,9 +1839,14 @@ pub fn pretty_step_name<S: Step>() -> String {
1839
1839
/// Renders `step` using its `Debug` implementation and extract the field arguments out of it.
1840
1840
fn step_debug_args < S : Step > ( step : & S ) -> String {
1841
1841
let step_dbg_repr = format ! ( "{step:?}" ) ;
1842
- let brace_start = step_dbg_repr. find ( '{' ) . unwrap_or ( 0 ) ;
1843
- let brace_end = step_dbg_repr. rfind ( '}' ) . unwrap_or ( step_dbg_repr. len ( ) ) ;
1844
- step_dbg_repr[ brace_start + 1 ..brace_end - 1 ] . trim ( ) . to_string ( )
1842
+
1843
+ // Some steps do not have any arguments, so they do not have the braces
1844
+ match ( step_dbg_repr. find ( '{' ) , step_dbg_repr. rfind ( '}' ) ) {
1845
+ ( Some ( brace_start) , Some ( brace_end) ) => {
1846
+ step_dbg_repr[ brace_start + 1 ..brace_end - 1 ] . trim ( ) . to_string ( )
1847
+ }
1848
+ _ => String :: new ( ) ,
1849
+ }
1845
1850
}
1846
1851
1847
1852
fn pretty_print_step < S : Step > ( step : & S ) -> String {
You can’t perform that action at this time.
0 commit comments