Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Iterator for bitflags #204

Closed
wants to merge 8 commits into from
Closed

Commits on Dec 10, 2019

  1. Implement Iterator for bitflagsAdds a new iter() method to bitflags…

    … that returns an iterator over all the enabled flags.Uses `iter::from_fn` to create the iterator to avoid having to add a new struct to the macro which would require a parameter specifying it's name.
    arturoc committed Dec 10, 2019
    Configuration menu
    Copy the full SHA
    6f56d07 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. iter: add comment

    arturoc committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    d4cd1ee View commit details
    Browse the repository at this point in the history

Commits on May 16, 2021

  1. fix warning

    arturoc committed May 16, 2021
    Configuration menu
    Copy the full SHA
    826581c View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2022

  1. from_bits_(truncate) fail with composite flags

    When a bitflags type contains composite flags like:
    
    ```rs
    bitflags! {
        struct Flags: u8 {
                const A = 0b00000001;
                const BC = 0b00000110;
        }
    }
    ```
    
    from_bits and from_bits_truncate would not work as expected allowing flags that are not declared.
    
    Fixes bitflags#275
    arturoc committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    8b10fe1 View commit details
    Browse the repository at this point in the history
  2. New iterator implementation

    Uses an array to store all the possible combinations and checks one by one all of them until the flag or the array is empty.
    
    Requires a higher version of rust (1.51) since it needs const generics.
    arturoc committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    6250b31 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b0f8b71 View commit details
    Browse the repository at this point in the history
  4. serde tests fail in CI

    Cause Serialize and Deserialize derives are used from serde:: instead of serde_derive::
    arturoc committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    5787e70 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ccffb65 View commit details
    Browse the repository at this point in the history