size
A crate for expressing, formatting, and interacting with file sizes
0.5.0
4.1M downloads/mo
#4942 most downloaded on crates.io
neosmart/prettysize-rs
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 4 months to 3.5 years
Most releases are documented
notes for 6 of 10 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
12 releases · first in 2018
0 releases in the last 12 months
see the full history below
Release timeline
12 releases · Aug 2018 to Feb 2025Releases
latest 12-
0.5.002 Feb 2025Release notes
Open source →What's Changed
- Support deserializing from string types with
Size::from_str()by @mqudsi in #11 - Re-export consts from crate root
- Update consts documentation
- Add rust GitHub CI pipeline
- fix: cargo clippy warnings by @Antosser in #8
- feat: Derive more traits by @Antosser in #9
Full Changelog: 0.4.1...0.5.0
This is the same release as 0.5.0-preview2 but with some clippy lints addressed.
- Support deserializing from string types with
-
0.5.0-preview227 Apr 2024 pre-releaseNothing published for this version
-
0.5.0-preview126 Apr 2024 pre-release -
0.4.113 Oct 2022Release notes
Open source →This update includes some hidden improvements as well as a few public-facing API changes.
New features:
Sizenow implementsAddAssign,SubAssign,MulAssign, andDivAssign.SizeFormatter::new()is now a const function.
Improvements:
- Crate documentation has been improved further.
- The MSRV (which is not guaranteed) has been reduced and currently the crate
builds with rust 1.46.0. - Crate tests have been modified to pass on older versions of the rust compiler.
- The
FormattableSizeandSizeFormatterAPIs have been coalesced into the
latter, reducing duplication and simplifying crate internals.
Special thanks to first-time contributors @angusholder and @vic1707.
-
0.4.023 Jun 2022Nothing published for this version
-
0.3.122 Jun 2022Nothing published for this version
-
0.3.021 Jun 2022 -
0.2.121 Jun 2022Nothing published for this version
-
0.2.017 Jun 2022Release notes
Open source →This is a major (and slightly breaking) update to the PrettySize
sizecrate,
bringing significant new features, improvements to the API, and a complete
overhaul of the documentation.The major changes from v0.1.x are outlined below:
- Support for mathematical operations on strongly-typed
Size<T>sizes, that
include support for adding and subtractingSizeinstances and for
multiplying/dividingSizeinstances by scalar values, - Support (both for creating/handling and for formatting/printing) negative file
sizes, required to express the potentially negative difference between two
Sizevalues, Sizenow implementsPartialEqsoSizevalues can be compared directly
(instead of having to comparesize1.bytes()andsize2.bytes()),- Abbrevations are now available for the various strongly-typed
Size
discriminants, e.g. you can uselet foo = Size::KiB(2);instead oflet foo = Size::Kibibytes(2)(the resulting type is still the same for both), - The scalar constants have been moved from the crate root to
size::conststo
discourage their use in favor of the strongly-typedSize<T>approach, Sizeinstances can be compared for equality both directly and via
references,Sizeinstances can now be compared for order (viaPartialOrd),- The
sizecrate can now be used inno_stdmode by compiling with default
features disabled (see the crate-level documentation for more info), - All types and methods have been extensively documented in addition to
extensive crate- and module-level documentation.
- Support for mathematical operations on strongly-typed
-
0.1.207 Dec 2018Release notes
Open source →The definition for TERABYTE was incorrect thanks to a fat-fingered
copy-and-paste, leading to future base-10 definitions being off by a
factor of 10^3. Thanks to @teschty for catching this. -
0.1.116 Aug 2018 -
0.1.011 Aug 2018Nothing published for this version