@@ -97,11 +97,10 @@ where
97
97
}
98
98
99
99
fn node_label ( & self , block : & Self :: Node ) -> dot:: LabelText < ' _ > {
100
- let mut label = Vec :: new ( ) ;
101
100
let mut cursor = self . cursor . borrow_mut ( ) ;
102
101
let mut fmt =
103
102
BlockFormatter { cursor : & mut cursor, style : self . style , bg : Background :: Light } ;
104
- fmt. write_node_label ( & mut label , * block) . unwrap ( ) ;
103
+ let label = fmt. write_node_label ( * block) . unwrap ( ) ;
105
104
106
105
dot:: LabelText :: html ( String :: from_utf8 ( label) . unwrap ( ) )
107
106
}
@@ -172,7 +171,9 @@ where
172
171
bg
173
172
}
174
173
175
- fn write_node_label ( & mut self , w : & mut impl io:: Write , block : BasicBlock ) -> io:: Result < ( ) > {
174
+ fn write_node_label ( & mut self , block : BasicBlock ) -> io:: Result < Vec < u8 > > {
175
+ use std:: io:: Write ;
176
+
176
177
// Sample output:
177
178
// +-+-----------------------------------------------+
178
179
// A | bb4 |
@@ -199,6 +200,9 @@ where
199
200
// attributes. Make sure to test the output before trying to remove the redundancy.
200
201
// Notably, `align` was found to have no effect when applied only to <table>.
201
202
203
+ let mut v = vec ! [ ] ;
204
+ let w = & mut v;
205
+
202
206
let table_fmt = concat ! (
203
207
" border=\" 1\" " ,
204
208
" cellborder=\" 1\" " ,
@@ -327,7 +331,9 @@ where
327
331
_ => { }
328
332
} ;
329
333
330
- write ! ( w, "</table>" )
334
+ write ! ( w, "</table>" ) ?;
335
+
336
+ Ok ( v)
331
337
}
332
338
333
339
fn write_block_header_simple (
0 commit comments