Skip to content

Commit

Permalink
Fix Clippy issues in register-docs gated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Nov 3, 2024
1 parent 999168e commit b2953fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions godot-macros/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn make_definition_docs(
let base_escaped = xml_escape(base);
let desc_escaped = xml_escape(make_docs_from_attributes(description)?);
let members = members
.into_iter()
.iter()
.filter(|x| x.var.is_some() | x.export.is_some())
.filter_map(member)
.collect::<String>();
Expand Down Expand Up @@ -111,7 +111,7 @@ fn siphon_docs_from_attributes(doc: &[Attribute]) -> impl Iterator<Item = String
_ => None,
})
.flat_map(|doc| {
doc.into_iter().map(|x| {
doc.iter().map(|x| {
x.to_string()
.trim_start_matches('r')
.trim_start_matches('#')
Expand All @@ -125,7 +125,7 @@ fn siphon_docs_from_attributes(doc: &[Attribute]) -> impl Iterator<Item = String

fn xml_escape(value: String) -> String {
// Most strings have no special characters, so this check helps avoid unnecessary string copying
if !value.contains(&['&', '<', '>', '"', '\'']) {
if !value.contains(['&', '<', '>', '"', '\'']) {
return value;
}

Expand Down
2 changes: 1 addition & 1 deletion godot-macros/src/docs/markdown_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn walk_node(node: &md::Node, definitions: &HashMap<&str, &str>) -> Option<Strin

Html(html) => html.value.clone(),

_ => walk_nodes(&node.children()?, definitions, ""),
_ => walk_nodes(node.children()?, definitions, ""),
};

Some(bbcode)
Expand Down

0 comments on commit b2953fb

Please sign in to comment.