mirror of https://github.com/zcash/zip32.git
Compare commits
No commits in common. "master" and "v0.2.0" have entirely different histories.
|
@ -7,9 +7,6 @@ and this library adheres to Rust's notion of
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- `zip32::AccountId::const_from_u32`
|
||||
|
||||
## [0.2.0] - 2025-02-20
|
||||
|
||||
### Added
|
||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -73,18 +73,6 @@ impl AccountId {
|
|||
pub fn next(&self) -> Option<Self> {
|
||||
Self::try_from(self.0 + 1).ok()
|
||||
}
|
||||
|
||||
/// Constant function to construct an account ID from a u32.
|
||||
///
|
||||
/// # Panics
|
||||
/// Panics if the provided value is >= 2^31
|
||||
pub const fn const_from_u32(value: u32) -> Self {
|
||||
if value < (1 << 31) {
|
||||
Self(value)
|
||||
} else {
|
||||
panic!("Account IDs must be in the range 0..2^31");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The error type returned when a checked integral type conversion fails.
|
||||
|
|
Loading…
Reference in New Issue