Macro safe_format

Source
macro_rules! safe_format {
    ($($arg:tt)*) => { ... };
}
Expand description

Safe formatting macro that returns a SmartString

This macro is like format! but returns a SmartString and never panics. On formatting failure, it returns “”.

§Examples

let msg = safe_format!("Error code: {}", 42);
let err = safe_format!("Failed to connect: {}", e);