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

feat: more FixedBytes impls #111

Merged
merged 1 commit into from
Jun 13, 2023
Merged

feat: more FixedBytes impls #111

merged 1 commit into from
Jun 13, 2023

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Jun 13, 2023

Motivation

  • derive Into, IntoIterator
  • impl PartialEq, PartialOrd, Borrow with bytes
  • better Address docs and impls
  • checksum in Address Display
  • some methods like as_ptr don't need to be implemented here because we deref to array/slice
  • rename as_bytes to as_slice because we are already bytes

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes DaniPopes requested a review from prestwich June 13, 2023 21:23
/// Compile-time equality. NOT constant-time equality.
#[inline]
pub const fn const_eq(&self, other: &Self) -> bool {
let mut i = 0;
loop {
while i < N {
Copy link
Member

Choose a reason for hiding this comment

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

i honestly forgot while loops exist

@DaniPopes DaniPopes merged commit ba280e4 into main Jun 13, 2023
@DaniPopes DaniPopes deleted the dani/bytes-impls branch June 13, 2023 23:04
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.

2 participants