File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/librustc_driver/profile Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,18 @@ pub struct QueryMetric {
4343 pub dur_total : Duration ,
4444}
4545
46+ fn cons ( s : & str ) -> String {
47+ let first = s. split ( |d| d == '(' || d == '{' ) . next ( ) ;
48+ assert ! ( first. is_some( ) && first != Some ( "" ) ) ;
49+ first. unwrap ( ) . to_owned ( )
50+ }
51+
4652pub fn cons_of_query_msg ( q : & trace:: Query ) -> String {
47- let s = format ! ( "{:?}" , q. msg) ;
48- let cons: Vec < & str > = s. split ( |d| d == '(' || d == '{' ) . collect ( ) ;
49- assert ! ( cons. len( ) > 0 && cons[ 0 ] != "" ) ;
50- cons[ 0 ] . to_string ( )
53+ cons ( & format ! ( "{:?}" , q. msg) )
5154}
5255
5356pub fn cons_of_key ( k : & DepNode ) -> String {
54- let s = format ! ( "{:?}" , k) ;
55- let cons: Vec < & str > = s. split ( |d| d == '(' || d == '{' ) . collect ( ) ;
56- assert ! ( cons. len( ) > 0 && cons[ 0 ] != "" ) ;
57- cons[ 0 ] . to_string ( )
57+ cons ( & format ! ( "{:?}" , k) )
5858}
5959
6060// First return value is text; second return value is a CSS class
You can’t perform that action at this time.
0 commit comments