From 4f20de6d32d9873c59cb335b8c15255a69ee737b Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Tue, 13 Apr 2021 09:46:06 +0200 Subject: [PATCH] Fix `clippy:wrong_self_convention` error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> src/workspace/profile.rs:75:22 | 75 | fn to_toml_value(&self) -> value::Value { | ^^^^^ | = note: `-D clippy::wrong-self-convention` implied by `-D warnings` = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> src/workspace/profile.rs:102:22 | 102 | fn to_toml_value(&self) -> value::Value { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value --> src/workspace/profile.rs:121:22 | 121 | fn to_toml_value(&self) -> value::Value { | ^^^^^ | = help: consider choosing a less ambiguous name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention --- src/workspace/profile.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/workspace/profile.rs b/src/workspace/profile.rs index 96e6fefd..df40e526 100644 --- a/src/workspace/profile.rs +++ b/src/workspace/profile.rs @@ -72,7 +72,7 @@ pub enum OptLevel { } impl OptLevel { - fn to_toml_value(&self) -> value::Value { + fn to_toml_value(self) -> value::Value { match self { OptLevel::NoOptimizations => 0.into(), OptLevel::O1 => 1.into(), @@ -99,7 +99,7 @@ pub enum Lto { } impl Lto { - fn to_toml_value(&self) -> value::Value { + fn to_toml_value(self) -> value::Value { match self { Lto::ThinLocal => false.into(), Lto::Fat => "fat".into(), @@ -118,7 +118,7 @@ pub enum PanicStrategy { } impl PanicStrategy { - fn to_toml_value(&self) -> value::Value { + fn to_toml_value(self) -> value::Value { match self { PanicStrategy::Unwind => "unwind".into(), PanicStrategy::Abort => "abort".into(), -- GitLab