Getting rid of "Debug" derived implementation in the macro

This commit is contained in:
Dave Hrycyszyn
2024-06-25 14:04:43 +01:00
parent 28ddb07126
commit 9c00a7f30a
2 changed files with 9 additions and 9 deletions

View File

@@ -109,13 +109,13 @@ pub fn derive_json_crdt(input: OgTokenStream) -> OgTokenStream {
}
}
impl #impl_generics std::fmt::Debug for #ident #ty_generics #where_clause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut fields = Vec::new();
#(fields.push(format!("{}", #ident_strings.to_string()));)*
write!(f, "{{ {:?} }}", fields.join(", "))
}
}
// impl #impl_generics std::fmt::Debug for #ident #ty_generics #where_clause {
// fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// let mut fields = Vec::new();
// #(fields.push(format!("{}", #ident_strings.to_string()));)*
// write!(f, "{{ {:?} }}", fields.join(", "))
// }
// }
impl #impl_generics #crate_name::json_crdt::CrdtNode for #ident #ty_generics #where_clause {
fn apply(&mut self, op: #crate_name::op::Op<#crate_name::json_crdt::JsonValue>) -> #crate_name::json_crdt::OpState {

View File

@@ -9,7 +9,7 @@ pub mod keys;
pub mod websocket;
#[add_crdt_fields]
#[derive(Clone, CrdtNode, Serialize, Deserialize)]
#[derive(Clone, CrdtNode, Serialize, Deserialize, Debug)]
pub struct TransactionList {
pub list: ListCrdt<Transaction>,
}
@@ -22,7 +22,7 @@ impl TransactionList {
/// A fake Transaction struct we can use as a simulated payload
#[add_crdt_fields]
#[derive(Clone, CrdtNode, Serialize, Deserialize, PartialEq)]
#[derive(Clone, CrdtNode, Serialize, Deserialize, PartialEq, Debug)]
pub struct Transaction {
from: String,
to: String,