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

journald: fix clippy unwrap_or_default warning #2742

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Oct 9, 2023

The latest Clippy emits warnings for uses of unwrap_or_else with
functions that return a type's Default::default value, such as
.unwrap_or_else(String::new). Clippy would prefer us to use
unwrap_or_default instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...

@hawkw hawkw requested review from davidbarsky and a team as code owners October 9, 2023 16:36
Copy link
Member

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

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

Approved modulo the warning in tracing-attributes/tests/async_fn.rs:19

The latest Clippy emits warnings for uses of `unwrap_or_else` with
functions that return a type's `Default::default` value, such as
`.unwrap_or_else(String::new)`. Clippy would prefer us to use
`unwrap_or_default` instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...
Clippy doesn't like the redefinition of a binding with itself. I don't
think this was necessary for the bug we were reproducing here (as the
error test doesn't do this), so I removed it.
@hawkw hawkw merged commit f085b89 into master Oct 10, 2023
56 checks passed
@hawkw hawkw deleted the eliza/unwrap_or_default branch October 10, 2023 16:12
hawkw added a commit that referenced this pull request Oct 10, 2023
The latest Clippy emits warnings for uses of `unwrap_or_else` with
functions that return a type's `Default::default` value, such as
`.unwrap_or_else(String::new)`. Clippy would prefer us to use
`unwrap_or_default` instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...
hawkw added a commit that referenced this pull request Oct 12, 2023
The latest Clippy emits warnings for uses of `unwrap_or_else` with
functions that return a type's `Default::default` value, such as
`.unwrap_or_else(String::new)`. Clippy would prefer us to use
`unwrap_or_default` instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...
hawkw added a commit that referenced this pull request Oct 12, 2023
Clippy doesn't like the redefinition of a binding with itself. I don't
think this was necessary for the bug we were reproducing here (as the
error test doesn't do this), so I removed it.
davidbarsky pushed a commit that referenced this pull request Oct 12, 2023
The latest Clippy emits warnings for uses of `unwrap_or_else` with
functions that return a type's `Default::default` value, such as
`.unwrap_or_else(String::new)`. Clippy would prefer us to use
`unwrap_or_default` instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...
davidbarsky pushed a commit that referenced this pull request Oct 12, 2023
Clippy doesn't like the redefinition of a binding with itself. I don't
think this was necessary for the bug we were reproducing here (as the
error test doesn't do this), so I removed it.
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request Nov 21, 2023
The latest Clippy emits warnings for uses of `unwrap_or_else` with
functions that return a type's `Default::default` value, such as
`.unwrap_or_else(String::new)`. Clippy would prefer us to use
`unwrap_or_default` instead, which does the same thing.

This commit fixes the lint. Personally, I don't really care about this,
but it makes the warning go away...
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request Nov 21, 2023
Clippy doesn't like the redefinition of a binding with itself. I don't
think this was necessary for the bug we were reproducing here (as the
error test doesn't do this), so I removed it.
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