Login screen and api endpoint reorganization
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user