global: snapshot + lock file + better errors

This commit is contained in:
nym21
2025-08-07 17:29:30 +02:00
parent 4740610923
commit 03e3760152
38 changed files with 851 additions and 473 deletions

View File

@@ -72,11 +72,11 @@ impl<'a> Interface<'a> {
})
.map(|mut id| {
let mut res = self.vecs.id_to_index_to_vec.get(id.as_str());
if res.is_none() {
if let Ok(index) = Index::try_from(id.as_str()) {
id = index.possible_values().last().unwrap().to_string();
res = self.vecs.id_to_index_to_vec.get(id.as_str())
}
if res.is_none()
&& let Ok(index) = Index::try_from(id.as_str())
{
id = index.possible_values().last().unwrap().to_string();
res = self.vecs.id_to_index_to_vec.get(id.as_str())
}
(id, res)
})

View File

@@ -92,16 +92,16 @@ impl ParamsOpt {
}
pub fn to(&self) -> Option<i64> {
if self.to.is_none() {
if let Some(c) = self.count {
let c = c as i64;
if let Some(f) = self.from {
if f >= 0 || f.abs() > c {
return Some(f + c);
}
} else {
return Some(c);
if self.to.is_none()
&& let Some(c) = self.count
{
let c = c as i64;
if let Some(f) = self.from {
if f >= 0 || f.abs() > c {
return Some(f + c);
}
} else {
return Some(c);
}
}
self.to