Add test where container is passed to a function
This commit is contained in:
parent
85ad8a6fdc
commit
4ee65535a7
@ -153,3 +153,13 @@ fn method_without_side_effect(&self) {}
|
||||
let y = vec![1, 2, 3]; // Ok (false negative)
|
||||
y.method_without_side_effect();
|
||||
}
|
||||
|
||||
fn function_argument() {
|
||||
#[allow(clippy::ptr_arg)]
|
||||
fn foo<T>(v: &Vec<T>) -> usize {
|
||||
v.len()
|
||||
}
|
||||
|
||||
let x = vec![1, 2, 3]; // Ok
|
||||
foo(&x);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user