computer: remove the need for &mut vecs

This commit is contained in:
nym21
2025-04-28 11:21:28 +02:00
parent 9ae0a57f22
commit 15e6ef8488
19 changed files with 737 additions and 707 deletions

View File

@@ -104,10 +104,10 @@ where
fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Result<Vec<Self::T>>;
#[inline]
fn collect_inclusive_range(&self, from: I, to: I) -> Result<Vec<Self::T>> {
self.collect_range(Some(from.to_usize()?), Some(to.to_usize()? + 1))
}
// #[inline]
// fn collect_inclusive_range(&self, from: I, to: I) -> Result<Vec<Self::T>> {
// self.collect_range(Some(from.to_usize()?), Some(to.to_usize()? + 1))
// }
#[inline]
fn i64_to_usize(i: i64, len: usize) -> usize {
@@ -119,6 +119,7 @@ where
}
}
#[doc(hidden)]
fn collect_signed_range(&self, from: Option<i64>, to: Option<i64>) -> Result<Vec<Self::T>> {
let len = self.len();
let from = from.map(|i| Self::i64_to_usize(i, len));