diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-20 14:14:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-20 14:21:59 +0100 |
| commit | b73b4f33bcf0e4ff2cfa8438433205cd3a323e43 (patch) | |
| tree | b59ee2c6f46558b7e6a0b2b50e0f7e93afeb3ace /macros/src | |
| parent | dd331f007cb9c9968605f8d3eaef8fb498c21322 (diff) | |
Fix a few clippy lints
Diffstat (limited to 'macros/src')
| -rw-r--r-- | macros/src/func.rs | 6 | ||||
| -rw-r--r-- | macros/src/node.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/macros/src/func.rs b/macros/src/func.rs index fe06749b..3253455b 100644 --- a/macros/src/func.rs +++ b/macros/src/func.rs @@ -44,7 +44,7 @@ pub fn func(item: syn::Item) -> Result<TokenStream> { let vis = &item.vis; let ident = &item.sig.ident; let s = ident.to_string(); - let mut chars = s.trim_end_matches("_").chars(); + let mut chars = s.trim_end_matches('_').chars(); let ty = quote::format_ident!( "{}{}Func", chars.next().unwrap().to_ascii_uppercase(), @@ -98,8 +98,8 @@ pub fn section(docs: &mut String, title: &str, level: usize) -> Option<String> { let rest = &docs[start..]; let len = rest[1..] .find("\n# ") - .or(rest[1..].find("\n## ")) - .or(rest[1..].find("\n### ")) + .or_else(|| rest[1..].find("\n## ")) + .or_else(|| rest[1..].find("\n### ")) .map(|x| 1 + x) .unwrap_or(rest.len()); let end = start + len; diff --git a/macros/src/node.rs b/macros/src/node.rs index e8324594..cffac184 100644 --- a/macros/src/node.rs +++ b/macros/src/node.rs @@ -220,7 +220,7 @@ fn create(node: &Node) -> Result<TokenStream> { let scope = quote::format_ident!("__{}_keys", node.self_name); for property in node.properties.iter() { - let (key, module) = create_property_module(node, &property); + let (key, module) = create_property_module(node, property); modules.push(module); let name = &property.name; |
