@@ -225,16 +225,10 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'a, I> {
225225 url, test_escaped, channel
226226 ) )
227227 } ) ;
228- let title = if ignore {
229- let mut tmp = HashMap :: new ( ) ;
230- tmp. insert ( "title" . to_owned ( ) ,
231- "Be careful when using this code, it's not being tested!" . to_owned ( ) ) ;
232- Some ( tmp)
228+ let tooltip = if ignore {
229+ Some ( ( "Be careful when using this code, it's not being tested!" , "ignore" ) )
233230 } else if compile_fail {
234- let mut tmp = HashMap :: new ( ) ;
235- tmp. insert ( "title" . to_owned ( ) ,
236- "This code doesn't compile so be extra careful!" . to_owned ( ) ) ;
237- Some ( tmp)
231+ Some ( ( "This code doesn't compile so be extra careful!" , "compile_fail" ) )
238232 } else {
239233 None
240234 } ;
@@ -246,7 +240,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'a, I> {
246240 else { "" } ) ) ,
247241 None ,
248242 playground_button. as_ref ( ) . map ( String :: as_str) ,
249- title ) ) ;
243+ tooltip ) ) ;
250244 Some ( Event :: Html ( s. into ( ) ) )
251245 } )
252246 }
@@ -642,18 +636,10 @@ pub fn render(w: &mut fmt::Formatter,
642636 url, test_escaped, channel
643637 ) )
644638 } ) ;
645- let title = if ignore {
646- let mut tmp = HashMap :: new ( ) ;
647- tmp. insert ( "title" . to_owned ( ) ,
648- "Be careful when using this code, it's not being \
649- tested!". to_owned ( ) ) ;
650- Some ( tmp)
639+ let tooltip = if ignore {
640+ Some ( ( "Be careful when using this code, it's not being tested!" , "ignore" ) )
651641 } else if compile_fail {
652- let mut tmp = HashMap :: new ( ) ;
653- tmp. insert ( "title" . to_owned ( ) ,
654- "This code doesn't compile so be extra \
655- careful!". to_owned ( ) ) ;
656- Some ( tmp)
642+ Some ( ( "This code doesn't compile so be extra careful!" , "compile_fail" ) )
657643 } else {
658644 None
659645 } ;
@@ -665,7 +651,7 @@ pub fn render(w: &mut fmt::Formatter,
665651 else { "" } ) ) ,
666652 None ,
667653 playground_button. as_ref ( ) . map ( String :: as_str) ,
668- title ) ) ;
654+ tooltip ) ) ;
669655 hoedown_buffer_put ( ob, s. as_ptr ( ) , s. len ( ) ) ;
670656 } )
671657 }
0 commit comments