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 newly added clippy warnings #9

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

taiki-e
Copy link
Contributor

@taiki-e taiki-e commented Feb 12, 2024

warning: use of `or_insert_with` to construct default value
   --> lcov2cobertura/src/lib.rs:351:22
    |
351 |                     .or_insert_with(Package::default)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

warning: accessing first element with `args.files.get(0)`
  --> src/main.rs:68:15
   |
68 |     } else if args.files.get(0) == Some(&PathBuf::from("-")) {
   |               ^^^^^^^^^^^^^^^^^ help: try: `args.files.first()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
   = note: `#[warn(clippy::get_first)]` on by default

warning: accessing first element with `args
                     .files.get(0)`
  --> src/main.rs:75:24
   |
75 |           let filename = args
   |  ________________________^
76 | |             .files
77 | |             .get(0)
   | |___________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
help: try
   |
75 ~         let filename = args
76 +             .files.first()
   |

```
warning: use of `or_insert_with` to construct default value
   --> lcov2cobertura/src/lib.rs:351:22
    |
351 |                     .or_insert_with(Package::default)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

warning: accessing first element with `args.files.get(0)`
  --> src/main.rs:68:15
   |
68 |     } else if args.files.get(0) == Some(&PathBuf::from("-")) {
   |               ^^^^^^^^^^^^^^^^^ help: try: `args.files.first()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
   = note: `#[warn(clippy::get_first)]` on by default

warning: accessing first element with `args
                     .files.get(0)`
  --> src/main.rs:75:24
   |
75 |           let filename = args
   |  ________________________^
76 | |             .files
77 | |             .get(0)
   | |___________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
help: try
   |
75 ~         let filename = args
76 +             .files.first()
   |
```
@taiki-e taiki-e mentioned this pull request Feb 12, 2024
@mike-kfed
Copy link
Owner

thank you!

@mike-kfed mike-kfed merged commit 40eac02 into mike-kfed:main Feb 12, 2024
1 check passed
@taiki-e taiki-e deleted the clippy branch February 12, 2024 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