Skip to content

[Breaking] Update to bitflags 2.x #955

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

Closed
wants to merge 2 commits into from
Closed

[Breaking] Update to bitflags 2.x #955

wants to merge 2 commits into from

Conversation

GnomedDev
Copy link

Gets rid of this old duplicate dependency in my dep tree.

@whitequark
Copy link
Contributor

Does defmt no longer provide a derive macro?

@GnomedDev
Copy link
Author

bitflags 2.x swapped the internals of each bitflag type from just a newtype around the integer to a newtype around a private newtype. This means that derives that just try to touch the inner value can't work, hence having to make our own macro to implement formatting the bits.

@whitequark
Copy link
Contributor

Thanks. @Dirbaio what do you think about the macro? it feels a bit heavyweight but maybe that's just me.

@GnomedDev
Copy link
Author

I can change the macro to be separate and not replace the bitflags invocation, if that would be preferred, as in

bitflags::bitflags! {
	pub struct Flags: u8 {
		...
	}
}

impl_bitflags_defmt!(Flags);

@GnomedDev GnomedDev closed this by deleting the head repository Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants