Hi,
I have a (for simplicity) &[(String, String)], where first String corresponds to Args::name and the second String corresponds to Args::Value (of type Value::Str). How do I convert this to the Args struct? I can't get around the pub prev: Option<&'a Args<'a>> reference hell in the Args struct.
That is, I need to implement
fn to_args(args: &[(String, String)]) -> Args {
unimplemented!()
}
Any idea? Thank you.
Edit: It does not need to actually be a function. I'll use the resulting args to format the message immediately, so if there's a way to produce the Args inline, I'd be happy with that as well.
Hi,
I have a (for simplicity)
&[(String, String)], where first String corresponds toArgs::nameand the second String corresponds toArgs::Value(of typeValue::Str). How do I convert this to theArgsstruct? I can't get around thepub prev: Option<&'a Args<'a>>reference hell in theArgsstruct.That is, I need to implement
Any idea? Thank you.
Edit: It does not need to actually be a function. I'll use the resulting args to format the message immediately, so if there's a way to produce the Args inline, I'd be happy with that as well.