Skip to content

fix new clippy warnings #1690

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
merged 1 commit into from
Feb 26, 2022
Merged

Conversation

syphar
Copy link
Member

@syphar syphar commented Feb 26, 2022

No description provided.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Feb 26, 2022
@@ -270,6 +270,7 @@ impl Routes {
pattern.to_string(),
Box::new(RequestRecorder::new(
SimpleRedirect::new(|url| {
#[allow(clippy::unnecessary_to_owned)]
url.set_path(&url.path().trim_end_matches('/').to_string())
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, why doesn't removing to_string work?

Copy link
Member Author

Choose a reason for hiding this comment

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

error[E0502]: cannot borrow `*url` as mutable because it is also borrowed as immutable
   --> src/web/routes.rs:273:25
    |
273 |                         url.set_path(&url.path().trim_end_matches('/'))
    |                         ^^^^--------^^----------^^^^^^^^^^^^^^^^^^^^^^^
    |                         |   |         |
    |                         |   |         immutable borrow occurs here
    |                         |   immutable borrow later used by call
    |                         mutable borrow occurs here

if I'm not missing anything, we cannot get around this, right?

Copy link
Member

Choose a reason for hiding this comment

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

ah, makes sense - maybe report this upstream to clippy as a bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

will do that, when I can use clippy locally again and prepare a proper issue.

( I'm a victim of rust-lang/rust-clippy#8470 )

@syphar syphar merged commit 5665b99 into rust-lang:master Feb 26, 2022
@syphar syphar deleted the fix-clippy-warnings branch February 26, 2022 11:55
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Feb 26, 2022
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Mar 21, 2022
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