@@ -84,7 +84,7 @@ impl<'a> ToHtml for Cow<'a, str> {
8484
8585impl < ' a > ToHtml for Arguments < ' a > {
8686 fn html ( & self , buffer : & mut Html ) {
87- buffer. push_fmt ( * self ) ;
87+ let _ = buffer. write_fmt ( * self ) ;
8888 }
8989}
9090
@@ -111,7 +111,7 @@ macro_rules! impl_render_with_display {
111111 $(
112112 impl ToHtml for $ty {
113113 fn html( & self , buffer: & mut Html ) {
114- buffer . push_fmt ( format_args! ( "{self}" ) ) ;
114+ let _ = write! ( buffer , "{self}" ) ;
115115 }
116116 }
117117 ) *
@@ -247,20 +247,6 @@ impl Html {
247247 escape:: escape_to_string ( text, self . inner . to_mut ( ) ) ;
248248 }
249249
250- /// Appends a format string, escaping if necessary.
251- pub fn push_fmt ( & mut self , args : Arguments < ' _ > ) {
252- struct Escaper < ' a > ( & ' a mut Html ) ;
253-
254- impl < ' a > Write for Escaper < ' a > {
255- fn write_str ( & mut self , text : & str ) -> fmt:: Result {
256- self . 0 . push_text ( text) ;
257- Ok ( ( ) )
258- }
259- }
260-
261- let _ = Escaper ( self ) . write_fmt ( args) ;
262- }
263-
264250 /// Exposes the underlying buffer as a `&mut String`.
265251 ///
266252 /// # Security
@@ -283,6 +269,13 @@ impl Html {
283269 }
284270}
285271
272+ impl Write for Html {
273+ fn write_str ( & mut self , text : & str ) -> fmt:: Result {
274+ self . push_text ( text) ;
275+ Ok ( ( ) )
276+ }
277+ }
278+
286279impl ToHtml for Html {
287280 fn html ( & self , buffer : & mut Html ) {
288281 buffer. push ( self ) ;
0 commit comments