405405
406406#![ unstable]
407407
408- use string;
409-
410- pub use core:: fmt:: { Formatter , Result , Writer , rt} ;
408+ pub use core:: fmt:: { Formatter , Result , Writer , rt, SizeHint } ;
411409pub use core:: fmt:: { Show , String , Octal , Binary } ;
412410pub use core:: fmt:: { Display , Debug } ;
413411pub use core:: fmt:: { LowerHex , UpperHex , Pointer } ;
@@ -417,28 +415,3 @@ pub use core::fmt::{Argument, Arguments, write, radix, Radix, RadixFmt};
417415
418416#[ doc( hidden) ]
419417pub use core:: fmt:: { argument, argumentuint} ;
420-
421- /// The format function takes a precompiled format string and a list of
422- /// arguments, to return the resulting formatted string.
423- ///
424- /// # Arguments
425- ///
426- /// * args - a structure of arguments generated via the `format_args!` macro.
427- ///
428- /// # Example
429- ///
430- /// ```rust
431- /// use std::fmt;
432- ///
433- /// let s = fmt::format(format_args!("Hello, {}!", "world"));
434- /// assert_eq!(s, "Hello, world!".to_string());
435- /// ```
436- #[ unstable = "this is an implementation detail of format! and should not \
437- be called directly"]
438- pub fn format ( args : Arguments ) -> string:: String {
439- let min = String :: size_hint ( args) ;
440- let mut output = string:: String :: with_capacity ( min) ;
441- let _ = write ! ( & mut output, "{}" , args) ;
442- output. shrink_to_fit ( ) ;
443- output
444- }
0 commit comments