RS.CLIPPY.REF_OPTION_REF
Use `Option<&T>` instead of `&Option<&T>`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: ref_option_ref. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for usage of &Option<&T>.
Why is this bad?
Since & is Copy, it's useless to have a
reference on Option<&T>.
Known problems
It may be irrelevant to use this lint on public API code as it will make a breaking change to apply it.
Example
let x: &Option<&u32> = &Some(&0u32);
Use instead:
let x: Option<&u32> = Some(&0u32);