Commit 21d9eb7
committed
refactor: make string formatting more readable
To make the final output code easier to see:
* Get rid of the unnecessary line-noise of `.unwrap()`ing calls to
`write!()` by moving the `.unwrap()` into a macro.
* Join consecutive `write!()` calls using a single multiline format
string.
* Replace `.push()` and `.push_str(format!())` with `write!()`.
* If after doing all of the above, there is only a single `write!()`
call in the function, just construct the string directly with
`format!()`.1 parent 339593e commit 21d9eb7
1 file changed
+883
-793
lines changed
0 commit comments