Fix JMAP: Return unparsable ids in notFound / notUpdated / notDestroyed / notCopied instead of dropping them

This commit is contained in:
Maurus Decimus
2026-06-19 09:58:44 +02:00
parent d174e415fb
commit 79b9d08f03
47 changed files with 351 additions and 162 deletions

View File

@@ -41,7 +41,8 @@ impl<K: Eq + PartialEq, V> VecMap<K, V> {
}
#[inline(always)]
pub fn set(&mut self, key: K, value: V) -> bool {
pub fn set(&mut self, key: impl Into<K>, value: V) -> bool {
let key = key.into();
if let Some(kv) = self.inner.iter_mut().find(|kv| kv.key == key) {
kv.value = value;
false
@@ -52,19 +53,28 @@ impl<K: Eq + PartialEq, V> VecMap<K, V> {
}
#[inline(always)]
pub fn append(&mut self, key: K, value: V) {
self.inner.push(KeyValue { key, value });
pub fn append(&mut self, key: impl Into<K>, value: V) {
self.inner.push(KeyValue {
key: key.into(),
value,
});
}
#[inline(always)]
pub fn with_append(mut self, key: K, value: V) -> Self {
pub fn with_append(mut self, key: impl Into<K>, value: V) -> Self {
self.append(key, value);
self
}
#[inline(always)]
pub fn insert(&mut self, idx: usize, key: K, value: V) {
self.inner.insert(idx, KeyValue { key, value });
pub fn insert(&mut self, idx: usize, key: impl Into<K>, value: V) {
self.inner.insert(
idx,
KeyValue {
key: key.into(),
value,
},
);
}
#[inline(always)]