summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck_all.sh19
-rw-r--r--mingling_macros/src/groupped.rs14
2 files changed, 25 insertions, 8 deletions
diff --git a/check_all.sh b/check_all.sh
new file mode 100755
index 0000000..3ab7d9e
--- /dev/null
+++ b/check_all.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Change to the directory where the script is located
+cd "$(dirname "$0")"
+
+# Run cargo clippy in mingling_core
+cd mingling_core
+cargo clippy --fix --allow-dirty
+cd ..
+
+# Run cargo clippy in mingling_macros
+cd mingling_macros
+cargo clippy --fix --allow-dirty
+cd ..
+
+# Run cargo clippy in mingling
+cd mingling
+cargo clippy --fix --allow-dirty
+cd ..
diff --git a/mingling_macros/src/groupped.rs b/mingling_macros/src/groupped.rs
index 187ea46..2f9934f 100644
--- a/mingling_macros/src/groupped.rs
+++ b/mingling_macros/src/groupped.rs
@@ -11,14 +11,12 @@ use syn::{Attribute, DeriveInput, Ident, parse_macro_input};
/// Parses the `#[group(...)]` attribute to extract the group type
fn parse_group_attribute(attrs: &[Attribute]) -> Option<Ident> {
for attr in attrs {
- if attr.path().is_ident("group") {
- if let Ok(meta) = attr.parse_args::<syn::Meta>() {
- if let syn::Meta::Path(path) = meta {
- if let Some(segment) = path.segments.last() {
- return Some(segment.ident.clone());
- }
- }
- }
+ if attr.path().is_ident("group")
+ && let Ok(meta) = attr.parse_args::<syn::Meta>()
+ && let syn::Meta::Path(path) = meta
+ && let Some(segment) = path.segments.last()
+ {
+ return Some(segment.ident.clone());
}
}
None