patterns icon indicating copy to clipboard operation
patterns copied to clipboard

plug write! in format!?

Open masklinn opened this issue 6 years ago • 0 comments

The format! idiom notes:

It is possible to build up strings using the push and push_str methods on a mutable String, or using its + operator. However, it is often more convenient to use format!, especially where there is a mix of literal and non-literal strings.

Using write! on a String may not be quite as terse as the latter or as efficient as the former, but it's a pretty good (and generally more readable) alternative. It does require having std::fmt::Write in scope.

masklinn avatar Aug 30 '19 06:08 masklinn