405
405
406
406
#![ unstable]
407
407
408
- use string;
409
-
410
- pub use core:: fmt:: { Formatter , Result , Writer , rt} ;
408
+ pub use core:: fmt:: { Formatter , Result , Writer , rt, SizeHint } ;
411
409
pub use core:: fmt:: { Show , String , Octal , Binary } ;
412
410
pub use core:: fmt:: { Display , Debug } ;
413
411
pub use core:: fmt:: { LowerHex , UpperHex , Pointer } ;
@@ -417,28 +415,3 @@ pub use core::fmt::{Argument, Arguments, write, radix, Radix, RadixFmt};
417
415
418
416
#[ doc( hidden) ]
419
417
pub 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