We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There is a code https://os.phil-opp.com/hardware-interrupts/#handling-timer-interrupts
Any reason to make this:
impl InterruptIndex { fn as_u8(self) -> u8 { self as u8 } fn as_usize(self) -> usize { usize::from(self.as_u8()) } }
and not this:
impl InterruptIndex { fn as_usize(self) -> usize { usize::from(self as u8) } }
or even not to create as_usize at all, and just use as usize cast directly?
as_usize
as usize
Thanks for attention.
The text was updated successfully, but these errors were encountered:
as_u8 is used in various places where we actually need u8. as_usize could still be rewritten to not use as_u8 though.
as_u8
u8
Sorry, something went wrong.
Then wouldn't it be better to use as u8 or as usize everywhere and get rid off this impl's ?
as u8
I'd consider as u8 to be more noisy than .as_u8().
.as_u8()
No branches or pull requests
There is a code https://os.phil-opp.com/hardware-interrupts/#handling-timer-interrupts
Any reason to make this:
and not this:
or even not to create
as_usize
at all, and just useas usize
cast directly?Thanks for attention.
The text was updated successfully, but these errors were encountered: