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 some useful traits #41

Merged
merged 2 commits into from Mar 22, 2024
Merged

Conversation

kadiwa4
Copy link
Contributor

@kadiwa4 kadiwa4 commented Sep 27, 2023

Add implementations for fmt::Pointer, PartialEq, Eq, PartialOrd, Ord and Hash in analogy to NonNull.

In the second commit, I shorten the output of fmt::Debug (which is now also analogous to NonNull) because printing out VolatilePtr as an entire struct every time {:#?} formatting is used makes debug output harder to read. I can revert that commit if you disagree.

I also removed the T: Copy + fmt::Debug bounds on the fmt::Debug implementations because they made no sense to me.

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@phil-opp phil-opp merged commit ef6eb83 into rust-osdev:main Mar 22, 2024
4 of 5 checks passed
@phil-opp
Copy link
Member

Published as v0.5.2

@phil-opp
Copy link
Member

And sorry for the late review!

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.

None yet

2 participants