Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: expose helper methods for extracting bounds #138

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/storable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ pub(crate) const fn bounds<A: Storable>() -> Bounds {
}

/// Returns the max size of the given type if bounded, panics if unbounded.
pub(crate) const fn max_size<A: Storable>() -> u32 {
pub const fn max_size<A: Storable>() -> u32 {
if let Bound::Bounded { max_size, .. } = A::BOUND {
max_size
} else {
Expand All @@ -481,7 +481,7 @@ pub(crate) const fn max_size<A: Storable>() -> u32 {
}

/// Returns true if the type is fixed in size, false otherwise.
pub(crate) const fn is_fixed_size<A: Storable>() -> bool {
pub const fn is_fixed_size<A: Storable>() -> bool {
if let Bound::Bounded { is_fixed_size, .. } = A::BOUND {
is_fixed_size
} else {
Expand Down
Loading