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

Fix lint errors in Rust 1.73 and 1.74 #155

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Oct 6, 2023

Fixes the following which are new in Rust 1.73:

error: use of `or_insert_with` to construct default value
  --> src/changelog.rs:53:38
   |
53 | ...                   .or_insert_with(Vec::new);
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
   = note: `-D clippy::unwrap-or-default` implied by `-D warnings`

error: use of `or_insert_with` to construct default value
  --> src/changelog.rs:63:26
   |
63 |                         .or_insert_with(Vec::new);
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

And these from Rust 1.74 (only showing first error):

warning: unnecessary hashes around raw string literal
   --> src/changelog.rs:140:13
    |
140 | /             r#"
141 | | # Changelog
142 | |
143 | | All notable changes to this project will be documented in this file.
...   |
146 | | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
147 | |         "#
    | |__________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
...

GUS-W-14249468.

@edmorley edmorley self-assigned this Oct 6, 2023
Fixes the following which are new in Rust 1.73:

```
error: use of `or_insert_with` to construct default value
  --> src/changelog.rs:53:38
   |
53 | ...                   .or_insert_with(Vec::new);
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
   = note: `-D clippy::unwrap-or-default` implied by `-D warnings`

error: use of `or_insert_with` to construct default value
  --> src/changelog.rs:63:26
   |
63 |                         .or_insert_with(Vec::new);
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
```

And these from Rust 1.74 (only showing first error):

```
warning: unnecessary hashes around raw string literal
   --> src/changelog.rs:140:13
    |
140 | /             r#"
141 | | # Changelog
142 | |
143 | | All notable changes to this project will be documented in this file.
...   |
146 | | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
147 | |         "#
    | |__________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
...
```

GUS-W-14249468.
@edmorley edmorley force-pushed the edmorley/rust-1.7.3-clippy branch from 651210a to 94f881b Compare October 6, 2023 12:06
@edmorley edmorley marked this pull request as ready for review October 6, 2023 12:06
@edmorley edmorley requested a review from a team as a code owner October 6, 2023 12:06
@edmorley edmorley enabled auto-merge (squash) October 6, 2023 12:06
@edmorley edmorley merged commit b8cd45e into main Oct 6, 2023
@edmorley edmorley deleted the edmorley/rust-1.7.3-clippy branch October 6, 2023 12:08
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