Skip to content

fix a nit in the readme#307

Merged
KodrAus merged 1 commit into
bitflags:mainfrom
s1rius:patch-1
Mar 11, 2023
Merged

fix a nit in the readme#307
KodrAus merged 1 commit into
bitflags:mainfrom
s1rius:patch-1

Conversation

@s1rius

@s1rius s1rius commented Mar 11, 2023

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread README.md
const B = 0b00000010;
const C = 0b00000100;
const ABC = Self::A.bits | Self::B.bits | Self::C.bits;
const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do a function call when the value is there in a variable?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 2.x it's no longer in a field called bits, the library generates a newtype so the quickest migration is to use the method call instead.

@KodrAus KodrAus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @s1rius! This looks good to me

@KodrAus KodrAus merged commit 8011843 into bitflags:main Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants