refactor: clean up clippy lints
This commit is contained in:
parent
ac5533834d
commit
10946ea7a4
8
.github/workflows/lint.yaml
vendored
8
.github/workflows/lint.yaml
vendored
@ -56,13 +56,7 @@ jobs:
|
|||||||
run: rustup component add clippy rustfmt
|
run: rustup component add clippy rustfmt
|
||||||
|
|
||||||
- name: cargo clippy
|
- name: cargo clippy
|
||||||
run: >-
|
run: cargo clippy -- -D clippy::pedantic
|
||||||
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
|
|
||||||
|
|
||||||
- name: cargo fmt
|
- name: cargo fmt
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![allow(clippy::needless_pass_by_value, clippy::unnecessary_wraps)]
|
||||||
|
|
||||||
mod container;
|
mod container;
|
||||||
mod interaction;
|
mod interaction;
|
||||||
mod movement;
|
mod movement;
|
||||||
|
@ -4,7 +4,7 @@ use azalea::inventory::operations::{
|
|||||||
};
|
};
|
||||||
use mlua::{Result, Table};
|
use mlua::{Result, Table};
|
||||||
|
|
||||||
pub fn operation_from_table(op: Table, op_type: Option<u8>) -> Result<ClickOperation> {
|
pub fn operation_from_table(op: &Table, op_type: Option<u8>) -> Result<ClickOperation> {
|
||||||
Ok(match op_type.unwrap_or_default() {
|
Ok(match op_type.unwrap_or_default() {
|
||||||
0 => ClickOperation::Pickup(PickupClick::Left {
|
0 => ClickOperation::Pickup(PickupClick::Left {
|
||||||
slot: op.get("slot")?,
|
slot: op.get("slot")?,
|
||||||
|
@ -30,7 +30,7 @@ impl UserData for Container {
|
|||||||
"click",
|
"click",
|
||||||
|_, this, (operation, operation_type): (Table, Option<u8>)| {
|
|_, this, (operation, operation_type): (Table, Option<u8>)| {
|
||||||
this.0
|
this.0
|
||||||
.click(operation_from_table(operation, operation_type)?);
|
.click(operation_from_table(&operation, operation_type)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -66,7 +66,7 @@ impl UserData for ContainerRef {
|
|||||||
"click",
|
"click",
|
||||||
|_, this, (operation, operation_type): (Table, Option<u8>)| {
|
|_, this, (operation, operation_type): (Table, Option<u8>)| {
|
||||||
this.0
|
this.0
|
||||||
.click(operation_from_table(operation, operation_type)?);
|
.click(operation_from_table(&operation, operation_type)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![allow(clippy::needless_pass_by_value)]
|
||||||
|
|
||||||
use super::recorder::Recorder;
|
use super::recorder::Recorder;
|
||||||
use azalea::{
|
use azalea::{
|
||||||
ecs::{event::EventReader, system::Query},
|
ecs::{event::EventReader, system::Query},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user