Login screen and api endpoint reorganization

This commit is contained in:
Maurus Decimus
2026-04-05 19:57:23 +02:00
parent eecec0aa31
commit fde37b670f
29 changed files with 1005 additions and 1606 deletions

View File

@@ -273,7 +273,7 @@ impl RegistryJsonPatch for trc::Key {
pointer: JsonPointerPatch<'_>,
value: super::JmapValue<'x>,
) -> PatchResult<'x> {
if let Some(new_value) = value.as_str().and_then(|v| trc::Key::try_parse(v.as_ref())) {
if let Some(new_value) = value.as_str().and_then(|v| trc::Key::parse(v.as_ref())) {
*self = new_value;
pointer.assert_eof()
} else {

View File

@@ -86,6 +86,6 @@ impl<K: MapKey, V: IntoValue> IntoValue for VecMap<K, V> {
impl IntoValue for trc::Key {
fn into_value(self) -> JmapValue<'static> {
JmapValue::Str(self.name().into())
JmapValue::Str(self.as_str().into())
}
}

View File

@@ -220,10 +220,10 @@ where
impl Pickle for trc::Key {
fn pickle(&self, out: &mut Vec<u8>) {
self.code().pickle(out);
self.to_id().pickle(out);
}
fn unpickle(stream: &mut PickledStream<'_>) -> Option<Self> {
u64::unpickle(stream).and_then(Self::from_code)
u16::unpickle(stream).and_then(Self::from_id)
}
}