mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-11 14:41:16 -07:00
global: adding semester + making coarser intervals computed instead of eager
This commit is contained in:
12
crates/brk_core/src/traits/from_coarser.rs
Normal file
12
crates/brk_core/src/traits/from_coarser.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use std::ops::RangeInclusive;
|
||||
|
||||
pub trait FromCoarserIndex<T> {
|
||||
fn min_from(coarser: T) -> usize;
|
||||
fn max_from(coarser: T) -> usize;
|
||||
fn inclusive_range_from(coarser: T) -> RangeInclusive<usize>
|
||||
where
|
||||
T: Clone,
|
||||
{
|
||||
Self::min_from(coarser.clone())..=Self::max_from(coarser)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
mod from_coarser;
|
||||
mod printable;
|
||||
|
||||
pub use from_coarser::*;
|
||||
pub use printable::*;
|
||||
|
||||
Reference in New Issue
Block a user