Skip to content

Commit

Permalink
Resolve borrow_deref_ref clippy lint
Browse files Browse the repository at this point in the history
    error: deref on an immutable reference
       --> src/value/mod.rs:428:45
        |
    428 |             Value::Array(ref array) => Some(&*array),
        |                                             ^^^^^^^
        |
        = note: `-D clippy::borrow-deref-ref` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
    help: if you would like to reborrow, try removing `&*`
        |
    428 |             Value::Array(ref array) => Some(array),
        |                                             ~~~~~
    help: if you would like to deref, try using `&**`
        |
    428 |             Value::Array(ref array) => Some(&**array),
        |                                             ~~~~~~~~
  • Loading branch information
dtolnay committed Jun 7, 2022
1 parent de5c34b commit 45f1c4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl Value {
/// ```
pub fn as_array(&self) -> Option<&Vec<Value>> {
match *self {
Value::Array(ref array) => Some(&*array),
Value::Array(ref array) => Some(array),
_ => None,
}
}
Expand Down

0 comments on commit 45f1c4a

Please sign in to comment.