diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c6869c0..366882b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -56,13 +56,7 @@ jobs: run: rustup component add clippy rustfmt - name: cargo clippy - run: >- - cargo clippy -- -D clippy::pedantic - -A clippy::missing_errors_doc - -A clippy::missing_panics_doc - -A clippy::must_use_candidate - -A clippy::needless-pass-by-value - -A clippy::unnecessary-wraps + run: cargo clippy -- -D clippy::pedantic - name: cargo fmt if: always() diff --git a/src/lua/client/mod.rs b/src/lua/client/mod.rs index 4d4e514..21d7b5f 100644 --- a/src/lua/client/mod.rs +++ b/src/lua/client/mod.rs @@ -1,3 +1,5 @@ +#![allow(clippy::needless_pass_by_value, clippy::unnecessary_wraps)] + mod container; mod interaction; mod movement; diff --git a/src/lua/container/click.rs b/src/lua/container/click.rs index 7205a7a..63b1e54 100644 --- a/src/lua/container/click.rs +++ b/src/lua/container/click.rs @@ -4,7 +4,7 @@ use azalea::inventory::operations::{ }; use mlua::{Result, Table}; -pub fn operation_from_table(op: Table, op_type: Option) -> Result { +pub fn operation_from_table(op: &Table, op_type: Option) -> Result { Ok(match op_type.unwrap_or_default() { 0 => ClickOperation::Pickup(PickupClick::Left { slot: op.get("slot")?, diff --git a/src/lua/container/mod.rs b/src/lua/container/mod.rs index e1f1f13..a5206d7 100644 --- a/src/lua/container/mod.rs +++ b/src/lua/container/mod.rs @@ -30,7 +30,7 @@ impl UserData for Container { "click", |_, this, (operation, operation_type): (Table, Option)| { this.0 - .click(operation_from_table(operation, operation_type)?); + .click(operation_from_table(&operation, operation_type)?); Ok(()) }, ); @@ -66,7 +66,7 @@ impl UserData for ContainerRef { "click", |_, this, (operation, operation_type): (Table, Option)| { this.0 - .click(operation_from_table(operation, operation_type)?); + .click(operation_from_table(&operation, operation_type)?); Ok(()) }, ); diff --git a/src/replay/plugin.rs b/src/replay/plugin.rs index 11eb31b..c7cfed9 100644 --- a/src/replay/plugin.rs +++ b/src/replay/plugin.rs @@ -1,3 +1,5 @@ +#![allow(clippy::needless_pass_by_value)] + use super::recorder::Recorder; use azalea::{ ecs::{event::EventReader, system::Query},