Function fallible_collections::format::try_format
source · pub fn try_format(
max_capacity: usize,
args: Arguments<'_>
) -> Result<String, TryReserveError>
Expand description
Take a max capacity a try allocating a string with it.
Warning:
the max capacity must be > to the formating of the arguments. If writing the argument on the string exceed the capacity, no error is return and an allocation can occurs which can lead to a panic