Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - fix nightly clippy warnings #6395

Closed

Conversation

jakobhellermann
Copy link
Contributor

Objective

  • fix new clippy lints before they get stable and break CI

Solution

  • run clippy --fix to auto-fix machine-applicable lints
  • silence clippy::should_implement_trait for fn HandleId::default<T: Asset>

Changes

  • always prefer format!("{inline}") over format!("{}", not_inline)
  • prefer Box::default (or Box::<T>::default if necessary) over Box::new(T::default())

@jakobhellermann jakobhellermann added the C-Code-Quality A section of code that is hard to understand or change label Oct 28, 2022
Copy link
Contributor

@TimJentzsch TimJentzsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More consistency and shorter lines, looks good to me.

Notably, this PR also removes some (I'd guess) unnecessary as casts.

@jakobhellermann
Copy link
Contributor Author

Yes, that was a usize as usize cast.

Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are some tasty lints

@cart
Copy link
Member

cart commented Oct 28, 2022

bors r+

bors bot pushed a commit that referenced this pull request Oct 28, 2022
# Objective

- fix new clippy lints before they get stable and break CI

## Solution

- run `clippy --fix` to auto-fix machine-applicable lints
- silence `clippy::should_implement_trait` for `fn HandleId::default<T: Asset>`

## Changes
- always prefer `format!("{inline}")` over `format!("{}", not_inline)`
- prefer `Box::default` (or `Box::<T>::default` if necessary) over `Box::new(T::default())`
@bors bors bot changed the title fix nightly clippy warnings [Merged by Bors] - fix nightly clippy warnings Oct 28, 2022
@bors bors bot closed this Oct 28, 2022
@jakobhellermann jakobhellermann deleted the fix-clippy-warnings branch October 28, 2022 21:41
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- fix new clippy lints before they get stable and break CI

## Solution

- run `clippy --fix` to auto-fix machine-applicable lints
- silence `clippy::should_implement_trait` for `fn HandleId::default<T: Asset>`

## Changes
- always prefer `format!("{inline}")` over `format!("{}", not_inline)`
- prefer `Box::default` (or `Box::<T>::default` if necessary) over `Box::new(T::default())`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants