fix(build): Implement Debug for client struct

Fixes #298.
This commit is contained in:
James Nugent
2020-03-30 17:06:31 -05:00
committed by GitHub
parent 3cba9f5f6f
commit 6dbe88d445
+8
View File
@@ -15,6 +15,8 @@ pub fn generate<T: Service>(service: &T, proto_path: &str) -> TokenStream {
let connect = generate_connect(&service_ident);
let service_doc = generate_doc_comments(service.comment());
let struct_debug = format!("{} {{{{ ... }}}}", &service_ident);
quote! {
/// Generated client implementations.
pub mod #client_mod {
@@ -53,6 +55,12 @@ pub fn generate<T: Service>(service: &T, proto_path: &str) -> TokenStream {
}
}
}
impl<T> std::fmt::Debug for #service_ident<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, #struct_debug)
}
}
}
}
}