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 {
43
43
pub dur_total : Duration ,
44
44
}
45
45
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
+
46
52
pub 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) )
51
54
}
52
55
53
56
pub 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) )
58
58
}
59
59
60
60
// First return value is text; second return value is a CSS class
You can’t perform that action at this time.
0 commit comments