Fix tidy errors
This commit is contained in:
parent
217c88655b
commit
16c4afbde4
2 changed files with 9 additions and 6 deletions
|
@ -21,19 +21,22 @@ impl<T> Deref for DerefExample<T> {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let foo = &Foo(1u32);
|
let foo = &Foo(1u32);
|
||||||
let foo_clone: &Foo<u32> = foo.clone(); //~ WARNING call to method that does nothing [noop_method_call]
|
let foo_clone: &Foo<u32> = foo.clone();
|
||||||
|
//~^ WARNING call to method that does nothing [noop_method_call]
|
||||||
|
|
||||||
let bar = &Bar(1u32);
|
let bar = &Bar(1u32);
|
||||||
let bar_clone: Bar<u32> = bar.clone();
|
let bar_clone: Bar<u32> = bar.clone();
|
||||||
|
|
||||||
let deref = &&DerefExample(12u32);
|
let deref = &&DerefExample(12u32);
|
||||||
let derefed: &DerefExample<u32> = deref.deref(); //~ WARNING call to method that does nothing [noop_method_call]
|
let derefed: &DerefExample<u32> = deref.deref();
|
||||||
|
//~^ WARNING call to method that does nothing [noop_method_call]
|
||||||
|
|
||||||
let deref = &DerefExample(12u32);
|
let deref = &DerefExample(12u32);
|
||||||
let derefed: &u32 = deref.deref();
|
let derefed: &u32 = deref.deref();
|
||||||
|
|
||||||
let a = &&Foo(1u32);
|
let a = &&Foo(1u32);
|
||||||
let borrowed: &Foo<u32> = a.borrow(); //~ WARNING call to method that does nothing [noop_method_call]
|
let borrowed: &Foo<u32> = a.borrow();
|
||||||
|
//~^ WARNING call to method that does nothing [noop_method_call]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generic<T>(foo: &Foo<T>) {
|
fn generic<T>(foo: &Foo<T>) {
|
||||||
|
|
|
@ -7,19 +7,19 @@ LL | let foo_clone: &Foo<u32> = foo.clone();
|
||||||
= note: `#[warn(noop_method_call)]` on by default
|
= note: `#[warn(noop_method_call)]` on by default
|
||||||
|
|
||||||
warning: call to method that does nothing
|
warning: call to method that does nothing
|
||||||
--> $DIR/noop-method-call.rs:30:39
|
--> $DIR/noop-method-call.rs:31:39
|
||||||
|
|
|
|
||||||
LL | let derefed: &DerefExample<u32> = deref.deref();
|
LL | let derefed: &DerefExample<u32> = deref.deref();
|
||||||
| ^^^^^^^^^^^^^ unnecessary method call
|
| ^^^^^^^^^^^^^ unnecessary method call
|
||||||
|
|
||||||
warning: call to method that does nothing
|
warning: call to method that does nothing
|
||||||
--> $DIR/noop-method-call.rs:36:31
|
--> $DIR/noop-method-call.rs:38:31
|
||||||
|
|
|
|
||||||
LL | let borrowed: &Foo<u32> = a.borrow();
|
LL | let borrowed: &Foo<u32> = a.borrow();
|
||||||
| ^^^^^^^^^^ unnecessary method call
|
| ^^^^^^^^^^ unnecessary method call
|
||||||
|
|
||||||
warning: call to method that does nothing
|
warning: call to method that does nothing
|
||||||
--> $DIR/noop-method-call.rs:44:5
|
--> $DIR/noop-method-call.rs:47:5
|
||||||
|
|
|
|
||||||
LL | foo.clone();
|
LL | foo.clone();
|
||||||
| ^^^^^^^^^^^ unnecessary method call
|
| ^^^^^^^^^^^ unnecessary method call
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue