Simplify the borrow_deref_ref lint example

This commit is contained in:
Stanislav Tkach 2022-08-13 16:04:30 +02:00
parent 4d5d191f6a
commit 7727c303e5
No known key found for this signature in database
GPG Key ID: 5C12714F37319B1D

View File

@ -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,