File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -731,13 +731,6 @@ impl<'a> Formatter<'a> {
731731 self . buf . write_str ( data)
732732 }
733733
734- /// Writes a `char` to the underlying buffer contained within this
735- /// formatter.
736- #[ stable( feature = "fmt_write_char" , since = "1.1.0" ) ]
737- pub fn write_char ( & mut self , c : char ) -> Result {
738- self . buf . write_char ( c)
739- }
740-
741734 /// Writes some formatted information into this instance
742735 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
743736 pub fn write_fmt ( & mut self , fmt : Arguments ) -> Result {
@@ -899,6 +892,21 @@ impl<'a> Formatter<'a> {
899892 }
900893}
901894
895+ #[ stable( since = "1.2.0" , feature = "formatter_write" ) ]
896+ impl < ' a > Write for Formatter < ' a > {
897+ fn write_str ( & mut self , s : & str ) -> Result {
898+ self . buf . write_str ( s)
899+ }
900+
901+ fn write_char ( & mut self , c : char ) -> Result {
902+ self . buf . write_char ( c)
903+ }
904+
905+ fn write_fmt ( & mut self , args : Arguments ) -> Result {
906+ write ( self . buf , args)
907+ }
908+ }
909+
902910#[ stable( feature = "rust1" , since = "1.0.0" ) ]
903911impl Display for Error {
904912 fn fmt ( & self , f : & mut Formatter ) -> Result {
Original file line number Diff line number Diff line change 1515#![ allow( unknown_features) ]
1616#![ feature( box_syntax) ]
1717
18- use std:: fmt;
18+ use std:: fmt:: { self , Write } ;
1919use std:: usize;
2020
2121struct A ;
You can’t perform that action at this time.
0 commit comments