-
Notifications
You must be signed in to change notification settings - Fork 740
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidbarsky
approved these changes
Oct 9, 2023
There was a problem hiding this 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
force-pushed
the
eliza/unwrap_or_default
branch
from
October 9, 2023 18:46
3a8d85d
to
1f7ab5b
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest Clippy emits warnings for uses of
unwrap_or_else
withfunctions that return a type's
Default::default
value, such as.unwrap_or_else(String::new)
. Clippy would prefer us to useunwrap_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...