Rust-clippy: Enhance `option_as_ref_deref` lint with the |x| &**x case

Created on 24 Mar 2020  路  6Comments  路  Source: rust-lang/rust-clippy

In #4945, the option_as_ref_deref lint was added. This lint should be enhanced, so that it also detects:

opt.as_ref().map(|x| &**x)

_Originally posted by @Areredify in https://github.com/rust-lang/rust-clippy/pull/4945#issuecomment-577714718_

L-enhancement good-first-issue

Most helpful comment

If no one is working on this, I would like to take a stab.

All 6 comments

To be explicit, this should also probably cover opt.as_mut().map(|x| &mut **x).

If no one is working on this, I would like to take a stab.

I am trying to work on this, but I failed to open nightly rustc docs link in cheatsheet.

I search on bing.com but get nothing. Is it an intentional recent change or is it a temporary failure of something?

@shepmaster, thank you. Are there local version of this doc come with rustup doc?

Are there local version of this doc

I don't know. rustup doc --path will show you the path of your documentation; you can look around in there to see if you can find it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjaminGill-Metaswitch picture BenjaminGill-Metaswitch  路  22Comments

davemilter picture davemilter  路  18Comments

casey picture casey  路  19Comments

mikerite picture mikerite  路  17Comments

sanmai-NL picture sanmai-NL  路  23Comments