Update clippy_lints/src/needless_option_as_deref.rs

Co-authored-by: llogiq <bogusandre@gmail.com>
This commit is contained in:
lyj 2021-09-05 08:33:04 +08:00 committed by GitHub
parent 4184cc369a
commit 37af742bbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,10 +38,7 @@ declare_lint_pass!(OptionNeedlessDeref=> [
impl<'tcx> LateLintPass<'tcx> for OptionNeedlessDeref {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if expr.span.from_expansion() {
return;
}
if in_macro(expr.span) {
if expr.span.from_expansion() || in_macro(expr.span) {
return;
}
let typeck = cx.typeck_results();