-
2.3.3 Stable
released this
2023-06-26 23:26:33 -05:00 | 250 commits to main since this releaseChanges to
-=The
-=operator was incorrectly changed to truncate bits that didn't correspond to valid flags in2.3.0. This has
been fixed up so it once again behaves the same as-anddifference.Changes to
!The
!operator previously calledSelf::from_bits_truncate, which would truncate any bits that only partially
overlapped with a valid flag. It will now usebits & Self::all().bits(), so any bits that overlap any bits
specified by any flag will be respected. This is unlikely to have any practical implications, but enables defining
a flag likeconst ALL = !0as a way to signal that any bit pattern is a known set of flags.Changes to formatting
Zero-valued flags will never be printed. You'll either get
0x0for empty flags using debug formatting, or the
set of flags with zero-valued flags omitted for others.Composite flags will no longer be redundantly printed if there are extra bits to print at the end that don't correspond
to a valid flag.What's Changed
- Fix up incorrect sub assign behavior and other cleanups by @KodrAus in https://github.com/bitflags/bitflags/pull/366
Full Changelog: https://github.com/bitflags/bitflags/compare/2.3.2...2.3.3
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.3.2 Stable
released this
2023-06-13 00:22:43 -05:00 | 268 commits to main since this releaseWhat's Changed
- [doc] [src/lib.rs] delete redundant path prefix by @OccupyMars2025 in https://github.com/bitflags/bitflags/pull/361
- Prepare for 2.3.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/362
New Contributors
- @OccupyMars2025 made their first contribution in https://github.com/bitflags/bitflags/pull/361
Full Changelog: https://github.com/bitflags/bitflags/compare/2.3.1...2.3.2
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.3.1 Stable
released this
2023-05-17 09:24:43 -05:00 | 272 commits to main since this releaseWhat's Changed
- Fix Self in flags value expressions by @KodrAus in https://github.com/bitflags/bitflags/pull/355
- Prepare for 2.3.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/358
Full Changelog: https://github.com/bitflags/bitflags/compare/2.3.0...2.3.1
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.3.0 Stable
released this
2023-05-16 21:44:08 -05:00 | 280 commits to main since this releaseMajor changes
BitFlagstrait deprecated in favor ofFlagstraitThis release introduces the
Flagstrait and deprecates theBitFlagstrait. These two traits are semver compatible so if you have public API code depending onBitFlagsyou can move toFlagswithout breaking end-users. This is possible because theBitFlagstrait was never publicly implementable, so it now carriesFlagsas a supertrait. All implementations ofFlagsadditionally implementBitFlags.The
Flagstrait is a publicly implementable version of the oldBitFlagstrait. The originalBitFlagstrait carried some macro baggage that made it difficult to implement, so a newFlagstrait has been introduced as the One True Trait for interacting with flags types generically. See the themacro_freeandcustom_deriveexamples for more details.Bitstrait publicly exposedThe
Bitstrait for the underlying storage of flags values is also now publicly implementable. This lets you define your own exotic backing storage for flags. See thecustom_bits_typeexample for more details.What's Changed
- Use explicit hashes for actions steps by @KodrAus in https://github.com/bitflags/bitflags/pull/350
- Support ejecting flags types from the bitflags macro by @KodrAus in https://github.com/bitflags/bitflags/pull/351
Full Changelog: https://github.com/bitflags/bitflags/compare/2.2.1...2.3.0
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.2.1 Stable
released this
2023-04-24 01:32:36 -05:00 | 313 commits to main since this releaseWhat's Changed
- Refactor attribute filtering to apply per-flag by @KodrAus in https://github.com/bitflags/bitflags/pull/345
- Prepare for 2.2.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/346
Full Changelog: https://github.com/bitflags/bitflags/compare/2.2.0...2.2.1
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.2.0 (yanked) Stable
released this
2023-04-18 23:48:16 -05:00 | 318 commits to main since this releaseWhat's Changed
- Create SECURITY.md by @KodrAus in https://github.com/bitflags/bitflags/pull/338
- add docs to describe the behavior of multi-bit flags by @nicholasbishop in https://github.com/bitflags/bitflags/pull/340
- Add support for bytemuck by @KodrAus in https://github.com/bitflags/bitflags/pull/336
- Add a top-level macro for filtering attributes by @KodrAus in https://github.com/bitflags/bitflags/pull/341
- Prepare for 2.2.0 release by @KodrAus in https://github.com/bitflags/bitflags/pull/342
New Contributors
- @nicholasbishop made their first contribution in https://github.com/bitflags/bitflags/pull/340
Full Changelog: https://github.com/bitflags/bitflags/compare/2.1.0...2.2.0
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.1.0 Stable
released this
2023-04-05 17:47:07 -05:00 | 331 commits to main since this releaseWhat's Changed
- Add docs for the internal Field0 and examples of formatting/parsing by @KodrAus in https://github.com/bitflags/bitflags/pull/328
- Add support for arbitrary by @KodrAus in https://github.com/bitflags/bitflags/pull/324
- Fix up missing docs for consts within consts by @KodrAus in https://github.com/bitflags/bitflags/pull/330
- Ignore clippy lint in generated code by @Jake-Shadle in https://github.com/bitflags/bitflags/pull/331
- Prepare for 2.1.0 release by @KodrAus in https://github.com/bitflags/bitflags/pull/334
New Contributors
- @Jake-Shadle made their first contribution in https://github.com/bitflags/bitflags/pull/331
Full Changelog: https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.0.2 Stable
released this
2023-03-19 06:05:55 -05:00 | 343 commits to main since this releaseWhat's Changed
- Fix up missing isize and usize Bits impls by @KodrAus in https://github.com/bitflags/bitflags/pull/321
- Prepare for 2.0.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/322
Full Changelog: https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.0.1 Stable
released this
2023-03-15 21:02:36 -05:00 | 347 commits to main since this releaseWhat's Changed
- Fix up some docs issues by @KodrAus in https://github.com/bitflags/bitflags/pull/309
- Make empty_flag() const. by @tormeh in https://github.com/bitflags/bitflags/pull/313
- Fix formatting of multi-bit flags with partial overlap by @KodrAus in https://github.com/bitflags/bitflags/pull/316
- Prepare for 2.0.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/317
New Contributors
- @tormeh made their first contribution in https://github.com/bitflags/bitflags/pull/313
Full Changelog: https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
2.0.0 Stable
released this
2023-03-13 02:02:54 -05:00 | 357 commits to main since this releaseMajor changes
This release includes some major changes over
1.x. If you usebitflags!types in your public API then upgrading this library may cause breakage in your downstream users.⚠️ Serialization
You'll need to add the
serdeCargo feature in order to#[derive(Serialize, Deserialize)]on your generated flags types:bitflags! { #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct Flags: T { .. } }where
Tis the underlying bits type you're using, such asu32.The default serialization format with
serdehas changed if you#[derive(Serialize, Deserialize)]on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits type for compact formats.To keep the old format, see the https://github.com/KodrAus/bitflags-serde-legacy library.
⚠️ Traits
Generated flags types now derive fewer traits. If you need to maintain backwards compatibility, you can derive the following yourself:
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]⚠️ Methods
The unsafe
from_bits_uncheckedmethod is now a safefrom_bits_retainmethod.You can add the following method to your generated types to keep them compatible:
#[deprecated = "use the safe `from_bits_retain` method instead"] pub unsafe fn from_bits_unchecked(bits: T) -> Self { Self::from_bits_retain(bits) }where
Tis the underlying bits type you're using, such asu32.⚠️
.bitsfieldYou can now use the
.bits()method instead of the old.bits.The representation of generated flags types has changed from a struct with the single field
bitsto a newtype.Contributions
- Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259
- BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220
- Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261
- Sanitize
Okby @konsumlamm in https://github.com/bitflags/bitflags/pull/266 - Fix bug in
Debugimplementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268 - Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271
- Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272
- serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277
- Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279
- Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270
- Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278
- from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276
- Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280
- rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281
- Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282
- expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286
- Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287
- Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288
- Prepare for 2.0.0-rc.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/289
- Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291
- Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294
- serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296
- Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297
- Prepare for 2.0.0-rc.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/299
- Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301
- Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302
- Prepare for 2.0.0-rc.3 release by @KodrAus in https://github.com/bitflags/bitflags/pull/303
- feat: Add minimum permissions to rust.yml workflow by @gabibguti in https://github.com/bitflags/bitflags/pull/305
- fix a nit in the readme by @s1rius in https://github.com/bitflags/bitflags/pull/307
- Prepare for 2.0.0 release by @KodrAus in https://github.com/bitflags/bitflags/pull/306
New Contributors
- @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271
- @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272
- @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270
- @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291
- @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294
- @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296
- @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301
- @gabibguti made their first contribution in https://github.com/bitflags/bitflags/pull/305
- @s1rius made their first contribution in https://github.com/bitflags/bitflags/pull/307
Full Changelog: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads