workspace: use folder name for packages

This commit is contained in:
nym21
2025-02-05 23:42:48 +01:00
parent d86d614520
commit 5aaa55197e
33 changed files with 3776 additions and 1655 deletions

View File

@@ -590,6 +590,26 @@ where
})?;
Ok(self.flush()?)
}
pub fn compute_sum_from_indexes<T2, F>(
&mut self,
first_indexes: &mut StorableVec<I, T2, SINGLE_THREAD>,
last_indexes: &mut StorableVec<I, T2, SINGLE_THREAD>,
callback: F,
) -> Result<()>
where
T: From<T2>,
T2: StorableVecType + Copy + Add<usize, Output = T2> + Sub<T2, Output = T2> + TryInto<T>,
<T2 as TryInto<T>>::Error: error::Error + Send + Sync + 'static,
F: Fn(&T2) -> T,
{
first_indexes.iter_from(I::from(self.len()), |(i, first_index)| {
let last_index = last_indexes.get(i)?;
let count = *last_index + 1_usize - *first_index;
self.push_if_needed(i, count.into())
})?;
Ok(self.flush()?)
}
}
impl<I, T> StorableVec<I, T, ASYNC_READ_ONLY>

View File

@@ -1,6 +1,6 @@
use std::path::Path;
use storable_vec::{StorableVec, Version, ASYNC_READ_ONLY, CACHED_GETS, SINGLE_THREAD};
use storable_vec::{StorableVec, Version, CACHED_GETS, SINGLE_THREAD};
fn main() -> Result<(), Box<dyn std::error::Error>> {
{