Skip to content

Commit

Permalink
Configure lints for the workspace in Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Nov 29, 2023
1 parent dbc7ec5 commit 2e8d237
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[workspace]
rust-version = "1.74.0"
resolver = "2"
members = [
"bevy_asset_loader",
"bevy_asset_loader_derive"
]

[workspace.lints.clippy]
doc_markdown = "warn"
redundant_else = "warn"
match_same_arms = "warn"
semicolon_if_nothing_returned = "warn"
map_flatten = "warn"
manual_let_else = "warn"
3 changes: 3 additions & 0 deletions bevy_asset_loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ trybuild = { version = "1.0" }
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[[example]]
name = "two_collections"
path = "examples/two_collections.rs"
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/manual_dynamic_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ fn update_menu(
.value = format!(
"Background is {}",
if show_background.0 { "On" } else { "Off" }
)
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions bevy_asset_loader/src/loading_state/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn count_loaded_handles<S: States, Assets: AssetCollection>(cell: WorldCell) ->
config.loading_collections -= 1;
}
} else {
warn!("Failed to read loading state configuration in count_loaded_handles")
warn!("Failed to read loading state configuration in count_loaded_handles");
}

Some((done as u32, total as u32))
Expand All @@ -134,7 +134,7 @@ pub(crate) fn resume_to_finalize<S: States>(
next_user_state.set(failure);
}
} else {
warn!("Failed to read loading state configuration in resume_to_finalize")
warn!("Failed to read loading state configuration in resume_to_finalize");
}
}

Expand Down
3 changes: 3 additions & 0 deletions bevy_asset_loader_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ readme = "README.md"
[lib]
proc-macro = true

[lints]
workspace = true

[dependencies]
proc-macro2 = "1.0"
syn = "2.0"
Expand Down
4 changes: 2 additions & 2 deletions bevy_asset_loader_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn impl_asset_collection(
for error in errors {
match error {
ParseFieldError::NoAttributes => {
from_world_fields.push(field.clone().ident.unwrap())
from_world_fields.push(field.clone().ident.unwrap());
}
ParseFieldError::KeyAttributeStandsAlone => {
compile_errors.push(syn::Error::new_spanned(
Expand Down Expand Up @@ -418,7 +418,7 @@ fn parse_field(field: &Field) -> Result<AssetField, Vec<ParseFieldError>> {
} else {
errors.push(ParseFieldError::UnknownAttribute(
meta_path.into_token_stream(),
))
));
}
}
_ => {
Expand Down

0 comments on commit 2e8d237

Please sign in to comment.