Skip to content

Transfer implementation #362

Transfer implementation

Transfer implementation #362

GitHub Actions / clippy failed Nov 17, 2023 in 0s

clippy

12 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 12
Warning 0
Note 0
Help 0

Versions

  • rustc 1.76.0-nightly (a57770440 2023-11-16)
  • cargo 1.76.0-nightly (2c03e0e2d 2023-11-16)
  • clippy 0.1.76 (a577704 2023-11-16)

Annotations

Check failure on line 462 in solana/solana-ibc/programs/solana-ibc/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/lib.rs:462:85
    |
462 | ...s = [port_id.as_bytes().as_ref(), channel_id.as_bytes().as_ref()], bump, token::mint = token_mint, token::authority = sender)]
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `channel_id.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref

Check failure on line 462 in solana/solana-ibc/programs/solana-ibc/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/lib.rs:462:56
    |
462 |     #[account(init_if_needed, payer = sender, seeds = [port_id.as_bytes().as_ref(), channel_id.as_bytes().as_ref()], bump, token::mint = ...
    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `port_id.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref

Check failure on line 460 in solana/solana-ibc/programs/solana-ibc/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/lib.rs:460:56
    |
460 |     #[account(init_if_needed, payer = sender, seeds = [base_denom.as_bytes().as_ref()], bump, mint::decimals = 6, mint::authority = mint_...
    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `base_denom.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref

Check failure on line 214 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:214:43
    |
214 |             [port_id.as_bytes().as_ref(), channel_id.as_bytes().as_ref()];
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `channel_id.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref

Check failure on line 214 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:214:14
    |
214 |             [port_id.as_bytes().as_ref(), channel_id.as_bytes().as_ref()];
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `port_id.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref

Check failure on line 197 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

passing a unit value to a function

error: passing a unit value to a function
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:197:9
    |
197 |         Ok(anchor_spl::token::burn(cpi_ctx, amount_in_u64).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
    |
197 ~         anchor_spl::token::burn(cpi_ctx, amount_in_u64).unwrap();
198 +         Ok(())
    |

Check failure on line 151 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

passing a unit value to a function

error: passing a unit value to a function
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:151:9
    |
151 |         Ok(anchor_spl::token::mint_to(cpi_ctx, amount_in_u64).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
    |
151 ~         anchor_spl::token::mint_to(cpi_ctx, amount_in_u64).unwrap();
152 +         Ok(())
    |

Check failure on line 136 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this call to `as_ref` does nothing

error: this call to `as_ref` does nothing
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:136:26
    |
136 |         let inner = vec![MINT_ESCROW_SEED.as_ref(), bump_vector.as_ref()];
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `MINT_ESCROW_SEED`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
    = note: `-D clippy::useless-asref` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::useless_asref)]`

Check failure on line 102 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

passing a unit value to a function

error: passing a unit value to a function
   --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:102:9
    |
102 |         Ok(anchor_spl::token::transfer(cpi_ctx, amount_in_u64).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
    = note: `-D clippy::unit-arg` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unit_arg)]`
help: move the expression in front of the call and replace it with the unit literal `()`
    |
102 ~         anchor_spl::token::transfer(cpi_ctx, amount_in_u64).unwrap();
103 +         Ok(())
    |

Check failure on line 25 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:25:29
   |
25 |         Ok(Pubkey::from_str(&value.as_ref()).map(Self)?)
   |                             ^^^^^^^^^^^^^^^ help: change this to: `value.as_ref()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `-D clippy::needless-borrow` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 25 in solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

question mark operator is useless here

error: question mark operator is useless here
  --> solana/solana-ibc/programs/solana-ibc/src/transfer/impls.rs:25:9
   |
25 |         Ok(Pubkey::from_str(&value.as_ref()).map(Self)?)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `Pubkey::from_str(&value.as_ref()).map(Self)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
   = note: `-D clippy::needless-question-mark` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_question_mark)]`

Check failure on line 184 in solana/solana-ibc/programs/solana-ibc/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `inner`

error: unused variable: `inner`
   --> solana/solana-ibc/programs/solana-ibc/src/lib.rs:184:13
    |
184 |         let inner = store.try_into_inner().unwrap();
    |             ^^^^^ help: if this is intentional, prefix it with an underscore: `_inner`
    |
    = note: `-D unused-variables` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_variables)]`