Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 4, 2023
1 parent 5910f9b commit 4355e7f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion azalea-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ async fn auth_with_xbox_live(
Ok(ExpiringValue {
data: XboxLiveAuth {
token: res.token,
user_hash: res.display_claims["xui"].get(0).unwrap()["uhs"].clone(),
user_hash: res.display_claims["xui"].first().unwrap()["uhs"].clone(),
},
expires_at,
})
Expand Down
1 change: 0 additions & 1 deletion azalea-block/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![doc = include_str!("../README.md")]
#![feature(trait_upcasting)]

mod behavior;
mod generated;
Expand Down
1 change: 0 additions & 1 deletion azalea-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//! [`azalea`]: https://docs.rs/azalea
#![allow(incomplete_features)]
#![feature(trait_upcasting)]
#![feature(error_generic_member_access)]

mod account;
Expand Down
8 changes: 2 additions & 6 deletions azalea-physics/src/collision/mergers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl IndexMerger {
}
}

pub fn new_indirect(var1: &Vec<f64>, var2: &Vec<f64>, var3: bool, var4: bool) -> Self {
pub fn new_indirect(var1: &[f64], var2: &[f64], var3: bool, var4: bool) -> Self {
let mut var5 = f64::NAN;
let var7 = var1.len();
let var8 = var2.len();
Expand Down Expand Up @@ -204,11 +204,7 @@ impl IndexMerger {

pub trait IndexConsumer = FnMut(i32, i32, i32) -> bool;

fn for_non_swapped_indexes(
lower: &Vec<f64>,
upper: &Vec<f64>,
mut consumer: impl IndexConsumer,
) -> bool {
fn for_non_swapped_indexes(lower: &[f64], upper: &[f64], mut consumer: impl IndexConsumer) -> bool {
let var2 = lower.len();
for var3 in 0..var2 {
if !consumer(var3.try_into().unwrap(), -1, var3.try_into().unwrap()) {
Expand Down
9 changes: 3 additions & 6 deletions azalea/src/pathfinder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,10 @@ fn goto_listener(
pathfinder.is_calculating = true;

let start = if let Some(executing_path) = executing_path
&& let Some(final_node) = executing_path.path.back() {
&& let Some(final_node) = executing_path.path.back()
{
// if we're currently pathfinding and got a goto event, start a little ahead
executing_path
.path
.get(20)
.unwrap_or(final_node)
.target
executing_path.path.get(20).unwrap_or(final_node).target
} else {
BlockPos::from(position)
};
Expand Down

0 comments on commit 4355e7f

Please sign in to comment.