aboutsummaryrefslogtreecommitdiff
path: root/ebml_derive
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-01-27 21:48:22 +0100
committermetamuffin <metamuffin@disroot.org>2023-01-27 21:48:22 +0100
commita742f7dbd8bda0bf23a6d5273e5dd2f83b9d4c9f (patch)
tree49ba83ef7aec7b2bf4ff61b41c621696c45c6e95 /ebml_derive
parent04e3ebfdda613be0e58290a49536116cc57ad147 (diff)
downloadjellything-a742f7dbd8bda0bf23a6d5273e5dd2f83b9d4c9f.tar
jellything-a742f7dbd8bda0bf23a6d5273e5dd2f83b9d4c9f.tar.bz2
jellything-a742f7dbd8bda0bf23a6d5273e5dd2f83b9d4c9f.tar.zst
clippy
Diffstat (limited to 'ebml_derive')
-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