aboutsummaryrefslogtreecommitdiff
path: root/ebml_derive/src
diff options
context:
space:
mode:
Diffstat (limited to 'ebml_derive/src')
-rw-r--r--ebml_derive/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ebml_derive/src/lib.rs b/ebml_derive/src/lib.rs
index 2c0379f..18a43a9 100644
--- a/ebml_derive/src/lib.rs
+++ b/ebml_derive/src/lib.rs
@@ -35,7 +35,7 @@ pub fn define_ebml(ts: TokenStream) -> TokenStream {
"Float" => quote!((f64)),
"Utf8" => quote!((String)),
"Binary" => quote!((Vec<u8>)),
- _ => panic!("unsupported type {}", r#type),
+ _ => panic!("unsupported type {type}"),
},
})
.expect("parse type"),
@@ -69,7 +69,7 @@ pub fn define_ebml(ts: TokenStream) -> TokenStream {
|Tag {
id, name, r#type, ..
}| {
- if let Some(_) = r#type {
+ if r#type.is_some() {
Some(quote! { #id => Self::#name(crate::ReadValue::from_buf(data)?) })
} else {
None
@@ -79,7 +79,7 @@ pub fn define_ebml(ts: TokenStream) -> TokenStream {
.collect::<Vec<_>>();
let write_match = tags
.iter()
- .filter_map(|Tag { name, .. }| Some(quote! { Self::#name(v) => v.write_to(w) }))
+ .map(|Tag { name, .. }| quote! { Self::#name(v) => v.write_to(w) })
.collect::<Vec<_>>();
let cons_master_match = tags
.iter()
@@ -87,7 +87,7 @@ pub fn define_ebml(ts: TokenStream) -> TokenStream {
|Tag {
id, name, r#type, ..
}| {
- if let None = r#type {
+ if r#type.is_none() {
Some(quote! { #id => Self::#name(kind) })
} else {
None