File tree 1 file changed +5
-2
lines changed
compiler/rustc_graphviz/src 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -653,13 +653,13 @@ where
653
653
writeln ! ( w, r#" edge[{}];"# , content_attrs_str) ?;
654
654
}
655
655
656
+ let mut text = Vec :: new ( ) ;
656
657
for n in g. nodes ( ) . iter ( ) {
657
658
write ! ( w, " " ) ?;
658
659
let id = g. node_id ( n) ;
659
660
660
661
let escaped = & g. node_label ( n) . to_dot_string ( ) ;
661
662
662
- let mut text = Vec :: new ( ) ;
663
663
write ! ( text, "{}" , id. as_slice( ) ) . unwrap ( ) ;
664
664
665
665
if !options. contains ( & RenderOption :: NoNodeLabels ) {
@@ -677,6 +677,8 @@ where
677
677
678
678
writeln ! ( text, ";" ) . unwrap ( ) ;
679
679
w. write_all ( & text[ ..] ) ?;
680
+
681
+ text. clear ( ) ;
680
682
}
681
683
682
684
for e in g. edges ( ) . iter ( ) {
@@ -687,7 +689,6 @@ where
687
689
let source_id = g. node_id ( & source) ;
688
690
let target_id = g. node_id ( & target) ;
689
691
690
- let mut text = Vec :: new ( ) ;
691
692
write ! ( text, "{} -> {}" , source_id. as_slice( ) , target_id. as_slice( ) ) . unwrap ( ) ;
692
693
693
694
if !options. contains ( & RenderOption :: NoEdgeLabels ) {
@@ -701,6 +702,8 @@ where
701
702
702
703
writeln ! ( text, ";" ) . unwrap ( ) ;
703
704
w. write_all ( & text[ ..] ) ?;
705
+
706
+ text. clear ( ) ;
704
707
}
705
708
706
709
writeln ! ( w, "}}" )
You can’t perform that action at this time.
0 commit comments