I would like to convert a core::fmt::Arguments
type for a string type in rust. However, since the fields of Arguments
is private, I cannot directly convert it in to a string.
Can anyone advice on how to do this?
I would like to convert a core::fmt::Arguments
type for a string type in rust. However, since the fields of Arguments
is private, I cannot directly convert it in to a string.
Can anyone advice on how to do this?
Do you mean that you want to create a formatted string?
Arguments
implements Display
, so you could just use format!("{}", args)
. If you already have a string buffer, you can also write it directly, s.write_fmt(args)
.
You can just call .to_string()
.