Function std::fmt::format[src]
pub fn format(args: &Arguments) -> String
The format function takes a precompiled format string and a list of arguments, to return the resulting formatted string.
Arguments
- args - a structure of arguments generated via the
format_args!macro. Because this structure can only be safely generated at compile-time, this function is safe.
Example
fn main() { use std::fmt; let s = format_args!(fmt::format, "Hello, {}!", "world"); assert_eq!(s, "Hello, world!".to_string()); }use std::fmt; let s = format_args!(fmt::format, "Hello, {}!", "world"); assert_eq!(s, "Hello, world!".to_string());