Fix clippy warnings in identifiers and events-macros
This commit is contained in:
parent
56ff7c05e9
commit
3329dc7345
@ -10,8 +10,9 @@ use crate::event_parse::{to_kind_variation, EventKindVariation};
|
||||
pub fn expand_event(input: DeriveInput) -> syn::Result<TokenStream> {
|
||||
let ident = &input.ident;
|
||||
|
||||
let (_kind, var) = to_kind_variation(ident)
|
||||
.ok_or(syn::Error::new(Span::call_site(), "not a valid ruma event struct identifier"))?;
|
||||
let (_kind, var) = to_kind_variation(ident).ok_or_else(|| {
|
||||
syn::Error::new(Span::call_site(), "not a valid ruma event struct identifier")
|
||||
})?;
|
||||
|
||||
let (impl_gen, ty_gen, where_clause) = input.generics.split_for_impl();
|
||||
let is_generic = !input.generics.params.is_empty();
|
||||
|
@ -390,7 +390,7 @@ mod tests {
|
||||
let deserialized =
|
||||
from_str::<RoomVersionId>(r#""1""#).expect("Failed to convert RoomVersionId to JSON.");
|
||||
|
||||
assert_matches!(deserialized, RoomVersionId::Version1);
|
||||
assert_eq!(deserialized, RoomVersionId::Version1);
|
||||
assert!(deserialized.is_official());
|
||||
|
||||
assert_eq!(
|
||||
|
Loading…
x
Reference in New Issue
Block a user