simplify process_queue

This commit is contained in:
Aiden McClelland
2021-09-23 18:59:00 -06:00
committed by Aiden McClelland
parent e731d091b8
commit f4ce8598be
3 changed files with 70 additions and 32 deletions

View File

@@ -181,6 +181,11 @@ fn build_model_struct(
&self.0
}
}
impl core::ops::DerefMut for #model_name {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<patch_db::json_ptr::JsonPointer> for #model_name {
fn from(ptr: patch_db::json_ptr::JsonPointer) -> Self {
#model_name(#inner_model::from(ptr))
@@ -276,6 +281,11 @@ fn build_model_struct(
&self.0
}
}
impl core::ops::DerefMut for #model_name {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl #model_name {
#(
pub fn #child_fn_name(self) -> #child_model {
@@ -327,6 +337,11 @@ fn build_model_enum(base: &DeriveInput, _: &DataEnum, model_name: Option<Ident>)
&self.0
}
}
impl core::ops::DerefMut for #model_name {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<patch_db::json_ptr::JsonPointer> for #model_name {
fn from(ptr: patch_db::json_ptr::JsonPointer) -> Self {
#model_name(From::from(ptr))