Skip to content

Commit 38d4137

Browse files
committed
clippy fixes to bevy api gen
1 parent 06b657a commit 38d4137

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

crates/bevy_api_gen/src/meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl MetaLoader {
9494
let cache = self.cache.borrow();
9595
if cache.contains_key(crate_name) {
9696
trace!("Loading meta from cache for: {}", crate_name);
97-
return cache.get(crate_name).cloned();
97+
cache.get(crate_name).cloned()
9898
} else {
9999
trace!("Loading meta from filesystem for: {}", crate_name);
100100
drop(cache);

crates/bevy_api_gen/src/passes/find_methods_and_fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn type_is_supported_as_non_proxy_return_val<'tcx>(
391391
) -> bool {
392392
trace!("Checkign type is supported as non proxy return val: '{ty:?}' with param_env: '{param_env:?}'");
393393
if let TyKind::Ref(region, _, _) = ty.kind() {
394-
if !region.get_name().is_some_and(|rn| rn.as_str() == "'static") {
394+
if region.get_name().is_none_or(|rn| rn.as_str() != "'static") {
395395
return false;
396396
}
397397
}

crates/bevy_api_gen/src/template.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,8 @@ pub(crate) fn configure_tera_env(tera: &mut Tera, crate_name: &str) {
195195

196196
let file = syn::parse_file(&str)
197197
.map_err(|e| tera::Error::msg(e.to_string()))
198-
.map_err(|e| {
198+
.inspect_err(|e| {
199199
log::error!("prettyplease error on input: ```\n{}\n```", str);
200-
e
201200
})?;
202201

203202
let out = prettyplease::unparse(&file);

0 commit comments

Comments
 (0)