Skip to content

clippy: use replace with arg-list#472

Merged
orhun merged 1 commit intofishfolk:mainfrom
darnuria:clippy/replace
Oct 11, 2022
Merged

clippy: use replace with arg-list#472
orhun merged 1 commit intofishfolk:mainfrom
darnuria:clippy/replace

Conversation

@darnuria
Copy link
Copy Markdown
Contributor

Rationale:

warning: used consecutive `str::replace` call
   --> src/resources.rs:499:10
    |
499 |     name.replace(' ', "_").replace('.', "_").to_lowercase()
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([' ', '.'], "_")`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace
    = note: `#[warn(clippy::collapsible_str_replace)]` on by default

Rationale:
```
warning: used consecutive `str::replace` call
   --> src/resources.rs:499:10
    |
499 |     name.replace(' ', "_").replace('.', "_").to_lowercase()
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([' ', '.'], "_")`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace
    = note: `#[warn(clippy::collapsible_str_replace)]` on by default
```
@darnuria
Copy link
Copy Markdown
Contributor Author

(just seen the bevy rewrite no problem to close ;))

@orhun orhun changed the title [clippy] use replace with arg-list. clippy: use replace with arg-list Oct 11, 2022
@orhun orhun merged commit ce48a62 into fishfolk:main Oct 11, 2022
@darnuria darnuria deleted the clippy/replace branch October 11, 2022 19:22
@darnuria
Copy link
Copy Markdown
Contributor Author

Thanks for review and the game. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants