powerfmt
`powerfmt` is a library that provides utilities for formatting values. This crate makes it significantly easier to support filling to a minimum width with alignment, avoid heap allocation, and avoid repetitive calculations.
0.2.0
497M downloads/mo
#227 most downloaded on crates.io
jhpratt/powerfmt
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Too new to tell
only 1 release windows
Nearly every release is documented
notes for 4 of 4 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
4 releases · first in 2023
0 releases in the last 12 months
see the full history below
Release timeline
4 releases · Oct 2023 to Oct 2023Releases
latest 4-
0.2.013 Oct 2023Release notes
Open source →Added
padded_width_of!Metadata::padded_widthimpl SmartDisplay for char
Fixed
- The width of integers is now correct. It previous did not account for the sign of the integer.
- Flags for
FormatterOptionswork as expected. Previously, getters were implemented in such a way that effective prevented their use.
Changed
-
SmartDisplay::metadatareturnsMetadata<'_, Self>instead ofMetadata<'_, Self::Metadata>. This permitsMetadatato capture the lifetime of the type it is for, rather than relying on the user to provide (or infer) the correct lifetime.This affects any uses of wrapper types. If you need to return the metadata of an inner type, you can call
Metadata::reuseto change the type. The metadata of both types must be the same, and the lifetime of the wrapper type must be at most the lifetime of the inner type. These requirements are enforced by the compiler. -
Metadata::newrequiresselfbe provided as a parameter for the same reason. -
The bounds for
Debug,Clone, andCopyforMetadataare now what is strictly required.
Renamed
width→unpadded_widthwidth_of→padded_width_of
Removed
Metadata::width_of_many(padded_width_of!instead)
-
0.1.210 Oct 2023Release notes
Open source →Added
SmartDisplayis implemented for all integer types.
Changed
- The minimum supported Rust version is now 1.67.0.
-
0.1.108 Oct 2023Release notes
Open source →Fixed
The docs.rs build has been fixed, as it failed to deploy for v0.1.0.
-
0.1.008 Oct 2023Release notes
Open source →Added
buf::WriteBufferext::FormatterExtsmart_display::SmartDisplaysmart_display::FormatterOptionssmart_display::Metadatasmart_display::ManySmartDisplaysmart_display::delegatesmart_display::private_metadata