minor refactor of transactions

This commit is contained in:
Aiden McClelland
2021-04-27 14:59:53 -06:00
parent 235362bdab
commit f1febb6bb4
7 changed files with 421 additions and 375 deletions

View File

@@ -162,6 +162,11 @@ fn build_model_struct(
#model_name(#inner_model::from(ptr))
}
}
impl From<#model_name> for patch_db::json_ptr::JsonPointer {
fn from(model: #model_name) -> Self {
model.0.into()
}
}
impl AsRef<patch_db::json_ptr::JsonPointer> for #model_name {
fn as_ref(&self) -> &patch_db::json_ptr::JsonPointer {
self.0.as_ref()
@@ -242,6 +247,11 @@ fn build_model_struct(
#model_name(From::from(ptr))
}
}
impl From<#model_name> for patch_db::json_ptr::JsonPointer {
fn from(model: #model_name) -> Self {
model.0.into()
}
}
impl AsRef<patch_db::json_ptr::JsonPointer> for #model_name {
fn as_ref(&self) -> &patch_db::json_ptr::JsonPointer {
self.0.as_ref()
@@ -281,6 +291,11 @@ fn build_model_enum(base: &DeriveInput, _: &DataEnum, model_name: Option<Ident>)
#model_name(From::from(ptr))
}
}
impl From<#model_name> for patch_db::json_ptr::JsonPointer {
fn from(model: #model_name) -> Self {
model.0.into()
}
}
impl AsRef<patch_db::json_ptr::JsonPointer> for #model_name {
fn as_ref(&self) -> &patch_db::json_ptr::JsonPointer {
self.0.as_ref()