@@ -2,7 +2,7 @@ use crate::web::highlight;
22use comrak:: {
33 ExtensionOptions , Options , Plugins , RenderPlugins , adapters:: SyntaxHighlighterAdapter ,
44} ;
5- use std:: collections:: HashMap ;
5+ use std:: { collections:: HashMap , fmt } ;
66
77#[ derive( Debug ) ]
88struct CodeAdapter < F > ( F , Option < & ' static str > ) ;
@@ -12,10 +12,10 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
1212{
1313 fn write_highlighted (
1414 & self ,
15- output : & mut dyn std :: io :: Write ,
15+ output : & mut dyn fmt :: Write ,
1616 lang : Option < & str > ,
1717 code : & str ,
18- ) -> std :: io :: Result < ( ) > {
18+ ) -> Result < ( ) , fmt :: Error > {
1919 // comrak does not treat `,` as an info-string delimiter, so we do that here
2020 // TODO: https://github.com/kivikakk/comrak/issues/246
2121 let lang = lang. and_then ( |lang| lang. split ( ',' ) . next ( ) ) ;
@@ -24,17 +24,17 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
2424
2525 fn write_pre_tag (
2626 & self ,
27- output : & mut dyn std :: io :: Write ,
27+ output : & mut dyn fmt :: Write ,
2828 attributes : HashMap < String , String > ,
29- ) -> std :: io :: Result < ( ) > {
29+ ) -> Result < ( ) , fmt :: Error > {
3030 write_opening_tag ( output, "pre" , & attributes)
3131 }
3232
3333 fn write_code_tag (
3434 & self ,
35- output : & mut dyn std :: io :: Write ,
35+ output : & mut dyn fmt :: Write ,
3636 attributes : HashMap < String , String > ,
37- ) -> std :: io :: Result < ( ) > {
37+ ) -> Result < ( ) , fmt :: Error > {
3838 // similarly to above, since comrak does not treat `,` as an info-string delimiter it will
3939 // try to apply `class="language-rust,ignore"` for the info-string `rust,ignore`, so we
4040 // have to detect that case and fixup the class here
@@ -54,10 +54,10 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
5454}
5555
5656fn write_opening_tag (
57- output : & mut dyn std :: io :: Write ,
57+ output : & mut dyn fmt :: Write ,
5858 tag : & str ,
5959 attributes : & HashMap < String , String > ,
60- ) -> std :: io :: Result < ( ) > {
60+ ) -> Result < ( ) , fmt :: Error > {
6161 write ! ( output, "<{tag}" ) ?;
6262 for ( attr, val) in attributes {
6363 write ! ( output, " {attr}=\" {val}\" " ) ?;
0 commit comments