Compare commits
3 Commits
833835d8cb
...
10946ea7a4
Author | SHA1 | Date | |
---|---|---|---|
10946ea7a4 | |||
ac5533834d | |||
7b76108b41 |
8
.github/workflows/lint.yaml
vendored
8
.github/workflows/lint.yaml
vendored
@ -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()
|
||||
|
@ -2,7 +2,7 @@ use crate::build_info;
|
||||
use clap::Parser;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// A Minecraft utility bot
|
||||
/// A Minecraft bot with Lua scripting support
|
||||
#[derive(Parser)]
|
||||
#[command(version = build_info::version_formatted())]
|
||||
pub struct Arguments {
|
||||
|
@ -196,9 +196,8 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> Result<
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let listener = TcpListener::bind(address).await.map_err(|error| {
|
||||
let listener = TcpListener::bind(address).await.inspect_err(|error| {
|
||||
error!("failed to listen on {address}: {error:?}");
|
||||
error
|
||||
})?;
|
||||
debug!("http server listening on {address}");
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![allow(clippy::needless_pass_by_value, clippy::unnecessary_wraps)]
|
||||
|
||||
mod container;
|
||||
mod interaction;
|
||||
mod movement;
|
||||
|
@ -4,7 +4,7 @@ use azalea::inventory::operations::{
|
||||
};
|
||||
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() {
|
||||
0 => ClickOperation::Pickup(PickupClick::Left {
|
||||
slot: op.get("slot")?,
|
||||
|
@ -30,7 +30,7 @@ impl UserData for Container {
|
||||
"click",
|
||||
|_, this, (operation, operation_type): (Table, Option<u8>)| {
|
||||
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<u8>)| {
|
||||
this.0
|
||||
.click(operation_from_table(operation, operation_type)?);
|
||||
.click(operation_from_table(&operation, operation_type)?);
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
|
@ -131,7 +131,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
} else {
|
||||
Account::offline(&username)
|
||||
},
|
||||
server.as_ref(),
|
||||
server,
|
||||
)
|
||||
.await;
|
||||
eprintln!("{error}");
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![allow(clippy::needless_pass_by_value)]
|
||||
|
||||
use super::recorder::Recorder;
|
||||
use azalea::{
|
||||
ecs::{event::EventReader, system::Query},
|
||||
|
Loading…
x
Reference in New Issue
Block a user