Simplify the borrow_deref_ref lint example
This commit is contained in:
parent
4d5d191f6a
commit
7727c303e5
@ -29,20 +29,15 @@
|
|||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// fn foo(_x: &str) {}
|
|
||||||
///
|
|
||||||
/// let s = &String::new();
|
/// let s = &String::new();
|
||||||
///
|
///
|
||||||
/// let a: &String = &* s;
|
/// let a: &String = &* s;
|
||||||
/// foo(&*s);
|
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Use instead:
|
/// Use instead:
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # fn foo(_x: &str) {}
|
|
||||||
/// # let s = &String::new();
|
/// # let s = &String::new();
|
||||||
/// let a: &String = s;
|
/// let a: &String = s;
|
||||||
/// foo(&**s);
|
|
||||||
/// ```
|
/// ```
|
||||||
#[clippy::version = "1.63.0"]
|
#[clippy::version = "1.63.0"]
|
||||||
pub BORROW_DEREF_REF,
|
pub BORROW_DEREF_REF,
|
||||||
|
Loading…
Reference in New Issue
Block a user