Owez / argi

Argument parsing for the future 🚀
https://crates.io/crates/argi
Apache License 2.0
128 stars 1 forks source link

Less janky code for string writes #3

Closed Owez closed 2 years ago

Owez commented 3 years ago

https://github.com/Owez/clonk/blob/15e8676fe218f63a4f6ca36f4f33300161f9c2d3/src/lib.rs#L293

Self-explanatory once you read the rest of it; the current .push_str() and format!() system isn't the best and should be replaced by a write!() macro.

The reason why the function itself returns String is to simplify the logistics of getting it's length compared to writing directly to the buffer, due to how the tab_to function works to format help (currently, see #2).

Owez commented 2 years ago

Seems like this was already done, seems good to me with write_fmt for io::Write