chore: new cargo fmt (#1266)

This commit is contained in:
Greg Johnston 2023-07-02 17:01:39 -04:00 committed by GitHub
parent 568f7b21ae
commit e821efca07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -438,15 +438,18 @@ impl Docs {
let mut attrs = attrs
.iter()
.filter_map(|attr| {
let Meta::NameValue(attr ) = &attr.meta else {
return None
let Meta::NameValue(attr) = &attr.meta else {
return None;
};
if !attr.path.is_ident("doc") {
return None
return None;
}
let Some(val) = value_to_string(&attr.value) else {
abort!(attr, "expected string literal in value of doc comment");
abort!(
attr,
"expected string literal in value of doc comment"
);
};
Some((val, attr.path.span()))

View file

@ -1374,8 +1374,8 @@ pub(crate) fn parse_event_name(name: &str) -> (TokenStream, bool, bool) {
let is_custom = event_type == "Custom";
let Ok(event_type) = event_type.parse::<TokenStream>() else {
abort!(event_type, "couldn't parse event name");
};
abort!(event_type, "couldn't parse event name");
};
let event_type = if is_custom {
quote! { Custom::new(#name) }
@ -1404,7 +1404,10 @@ pub(crate) fn slot_to_tokens(
let span = node.name().span();
let Some(parent_slots) = parent_slots else {
proc_macro_error::emit_error!(span, "slots cannot be used inside HTML elements");
proc_macro_error::emit_error!(
span,
"slots cannot be used inside HTML elements"
);
return;
};

View file

@ -385,9 +385,9 @@ impl Parse for ServerFnBody {
let docs = attrs
.iter()
.filter_map(|attr| {
let Meta::NameValue(attr ) = &attr.meta else {
return None
};
let Meta::NameValue(attr) = &attr.meta else {
return None;
};
if !attr.path.is_ident("doc") {
return None;
}