The format is based on Keep a Changelog, and this project adheres to Semantic Versioning 2.0.0.
- Inline the compile-time check in
write
, to remove an unwanted export.
- Fixed a bug where
{STYLE}
didn't format correctly.
- Redesign internal
write!
macro to ensure that format method short circuiting is always evaluated at compile time, rather than relying on an optimization of an iterator call.
- Improved detecting of empty format strings
What started as a simple collection of cleanup changes eventually spiraled out to the complete implementation of everything I've been looking to do for lazy_format
2.0. In particular, the improvements to if
necessitated minor but technically backwards incompatible macro changes, which presented the opportunity to make the other backwards incompatible changes, like removing deprecated functionality and simplifying macro definitions. In general, if you're only using lazy_format
and you aren't using horrorshow
, you shouldn't experience any breakages in the upgrade.
lazy_format
now supports implicit named parameters. Because we useformat_args!
internally, this support came automaticallylazy_format
'sif
,match
, andfor
syntaxes now allow for unparenthesized format literals, in cases where there's no arguments.
lazy_format
'sif
conditional version now allows omitting theelse
branch, in which case it will simply write nothing if none of the otherif
/else if
branches match.lazy_format
'selse
branch now requires the=>
syntax, for consistency (previously it was optional).- Upgrade to Edition 2021. This means we can use the new
pat
pattern, which correctly handles nested|
in patterns. This allows for much simpler macro definitions in a way that's fully backwards compatible (aside from the increased MSRV).
- Breaking Removed
semi_lazy_format
; the complexity of its implementation wasn't worth the added functionality. Instead, callers should manually evaluate any parameters they want to be eagerly evaluated before callinglazy_format
and then pass them manually. - Breaking Removed
horrorshow
feature, due to potential buggy interactions with transitive dependencies. Prefer instead to create adisplay
adapter which connectsDisplay
tohorrorshow
. - Breaking
semi_lazy_format!
no longer supports the deprecatedfmt => body
syntax; it now must use the|fmt| body
syntax.
- Fixed potential issue with ambiguous method call in the
for
loop version oflazy_format
make_lazy_format!
now has a closure-like syntax, using|f| { ... }
instead off => { ... }
. The older syntax is retained for backwards compatibility.
- Fix an issue where formatting without arguments (e.g,
lazy_format!("{}")
) would succeed incorrectly (#5).- Thanks @ten0 for the report.
- Changelog started