Skip to content

Commit b6a8779

Browse files
committed
Fix Clippy issues in register-docs gated code
1 parent 0af7118 commit b6a8779

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

godot-core/src/docs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub fn gather_xml_docs() -> impl Iterator<Item = String> {
8989
PluginItem::Struct {
9090
docs: Some(docs), ..
9191
} => map.entry(class_name).or_default().definition = docs,
92+
9293
_ => (),
9394
}
9495
});

godot-macros/src/docs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn make_definition_docs(
2121
let base_escaped = xml_escape(base);
2222
let desc_escaped = xml_escape(make_docs_from_attributes(description)?);
2323
let members = members
24-
.into_iter()
24+
.iter()
2525
.filter(|x| x.var.is_some() | x.export.is_some())
2626
.filter_map(member)
2727
.collect::<String>();
@@ -112,7 +112,7 @@ fn siphon_docs_from_attributes(doc: &[Attribute]) -> impl Iterator<Item = String
112112
_ => None,
113113
})
114114
.flat_map(|doc| {
115-
doc.into_iter().map(|x| {
115+
doc.iter().map(|x| {
116116
x.to_string()
117117
.trim_start_matches('r')
118118
.trim_start_matches('#')
@@ -126,7 +126,7 @@ fn siphon_docs_from_attributes(doc: &[Attribute]) -> impl Iterator<Item = String
126126

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

godot-macros/src/docs/markdown_converter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn walk_node(node: &md::Node, definitions: &HashMap<&str, &str>) -> Option<Strin
7979

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

82-
_ => walk_nodes(&node.children()?, definitions, ""),
82+
_ => walk_nodes(node.children()?, definitions, ""),
8383
};
8484

8585
Some(bbcode)

itest/rust/src/register_tests/constant_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ godot::sys::plugin_add!(
174174
raw: ::godot::private::callbacks::register_user_methods_constants::<HasOtherConstants>,
175175
},
176176
register_rpcs_fn: None,
177-
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
177+
#[cfg(feature = "register-docs")]
178178
docs: ::godot::docs::InherentImplDocs::default(),
179179
}),
180180
init_level: HasOtherConstants::INIT_LEVEL,

0 commit comments

Comments
 (0)