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

"variable does not need to be mutable" compile warnings in components/script #31820

Closed
Loirooriol opened this issue Mar 22, 2024 · 0 comments · Fixed by #31822
Closed

"variable does not need to be mutable" compile warnings in components/script #31820

Loirooriol opened this issue Mar 22, 2024 · 0 comments · Fixed by #31822
Labels
B-newcomer Newcomer-friendly issues. E-less-complex Straightforward. Recommended for a new contributor.

Comments

@Loirooriol
Copy link
Contributor

After #31813, when compiling I get

warning: variable does not need to be mutable
  --> components/script/dom/bindings/structuredclone.rs:58:5
   |
58 |     mut sc_holder: &mut StructuredDataHolder,
   |     ----^^^^^^^^^
   |     |
   |     help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
   --> components/script/dom/bindings/structuredclone.rs:169:13
    |
169 |         let mut sc_holder = &mut *(closure as *mut StructuredDataHolder);
    |             ----^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> components/script/dom/bindings/structuredclone.rs:197:13
    |
197 |         let mut sc_holder = &mut *(closure as *mut StructuredDataHolder);
    |             ----^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
  --> components/script/dom/crypto.rs:54:17
   |
54 |             let mut data = unsafe { input.as_mut_slice() };
   |                 ----^^^^
   |                 |
   |                 help: remove this `mut`

warning: variable does not need to be mutable
  --> components/script/dom/cssstyledeclaration.rs:75:25
   |
75 |                     let mut pdb = lock.write_with(&mut guard);
   |                         ----^^^
   |                         |
   |                         help: remove this `mut`
@Loirooriol Loirooriol added E-less-complex Straightforward. Recommended for a new contributor. B-newcomer Newcomer-friendly issues. C-untriaged New issues that haven't been triaged yet and removed C-untriaged New issues that haven't been triaged yet labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-newcomer Newcomer-friendly issues. E-less-complex Straightforward. Recommended for a new contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant