Comments (3)
The first version panics if optional_return_value()
returns None
, while the second one just returns None
. Such a transformation would be invalid.
from rust-clippy.
One valid rewrite would be Some(optional_return_value()?)
into optional_return_value()
, and this is already taken care of by the needless_question_mark
lint.
from rust-clippy.
There are
from rust-clippy.
Related Issues (20)
- rust-1.76.0 is missing from https://rust-lang.github.io/rust-clippy/ HOT 1
- False positive of `just_underscores_and_digits` when missing R_ANGLE when ending type prameters HOT 1
- items_after_statements shouldn't fire when const has no name HOT 1
- Warn when calling `is_empty` on non-empty value HOT 1
- Suggest replacing str::split with empty pattern with str::chars
- Remove unnecessary type from a typed literal HOT 1
- arithmetic_side_effects not triggered when `add_assign` used HOT 1
- FP `deref_addrof` HOT 4
- `must_use_unit` fails to apply if it's one of many attrs
- [Pattern_type_mismatch] clippy encouraging to dereference, but not needed.
- `unnecessary_to_owned` false positive when iterating over `Copy` types.
- ICE in `NEEDLESS_RETURN` when building lint span HOT 2
- redundant_pattern_matching failes to check whether contained value are used.
- `must_use_candidate` has faulty checking for side-effects HOT 1
- manual_swap lint suggestion doesnt compile HOT 3
- Redundant imports from `std` prelude in maybe-no_std crate HOT 2
- `?` error propagation lint breaks with try-blocks HOT 2
- Incorrect infinite loop detection in async functions HOT 2
- Unneeded casts in a comparison HOT 2
- GitHub Corner colors don't sync with the rest of the page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-clippy.