-
Notifications
You must be signed in to change notification settings - Fork 53
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
Opt-in automatic collection of expected values on alt
#415
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1466,6 +1466,31 @@ where | |
} | ||
} | ||
|
||
/// Used to compare checkpoints | ||
pub trait AsOrd { | ||
/// The type used to compare checkpoint positions | ||
type Ord: Ord + Clone + core::cmp::Ord + crate::lib::std::fmt::Debug; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove them. |
||
|
||
/// Get comparable value | ||
fn as_ord(&self) -> Self::Ord; | ||
} | ||
|
||
impl<'a, T> AsOrd for &'a [T] { | ||
type Ord = *const T; | ||
|
||
fn as_ord(&self) -> Self::Ord { | ||
self.as_ptr() | ||
} | ||
} | ||
|
||
impl<'a> AsOrd for &'a str { | ||
type Ord = *const u8; | ||
|
||
fn as_ord(&self) -> Self::Ord { | ||
self.as_ptr() | ||
} | ||
} | ||
|
||
/// Helper trait for types that can be viewed as a byte slice | ||
pub trait AsBytes { | ||
/// Casts the input type to a byte slice | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
Ord + core::cmp::Ord
redundant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, some oversight when combining the commits into one.