Skip to content

Commit

Permalink
Fix clippy:wrong_self_convention (use-ink#256)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Michael Müller authored Apr 13, 2021
1 parent ef1f2bd commit a8c8589
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/workspace/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down

0 comments on commit a8c8589

Please sign in to comment.