This commit is contained in:
vcoppe committed 2026-10-14 09:22:07 +02:00
1 parent 41b9116c6a
commit 97d597e139
181 files changed
+1970 -2643

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
//! Ids, which cross as strings (one id) or as concatenated 16-byte UUIDs (several).
use uuid::Uuid;
pub(crate) fn uuid_list(bytes: &[u8]) -> Option<Vec<Uuid>> {
let (chunks, rest) = bytes.as_chunks::<16>();
rest.is_empty()
.then(|| chunks.iter().map(|c| Uuid::from_bytes(*c)).collect())
}
pub(crate) fn parse_uuid(id: &str) -> Option<Uuid> {
Uuid::parse_str(id).ok()
}
pub(crate) fn same_len(a: &[f64], b: &[f64], c: &[f64]) -> bool {
a.len() == b.len() && b.len() == c.len()
}