Skip to content

Commit

Permalink
fix: fix CI errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Oct 14, 2023
1 parent f459100 commit b4d1dc6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ allow = [
"CC0-1.0",
"ISC",
"BSD-2-Clause",
"MPL-2.0", # TODO(zicklag): I believe MPL is fine for us, but maybe double-check this.
"BSD-2-Clause-Patent",
"MPL-2.0",
"OpenSSL",
]
default = "deny"
Expand Down
2 changes: 1 addition & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl SessionRunner for JumpyDefaultMatchRunner {
let Some(source) = &player_input.control_source else {
return;
};
player_input.control = input.get(source).unwrap().clone();
player_input.control = *input.get(source).unwrap();
});
}

Expand Down
14 changes: 7 additions & 7 deletions src/core/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ impl From<NavNode> for IVec2 {
}
impl std::cmp::Ord for NavNode {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.partial_cmp(other).unwrap()
}
}
impl std::cmp::PartialOrd for NavNode {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
let xcmp = self.0.x.cmp(&other.0.x);
Some(if xcmp == std::cmp::Ordering::Equal {
if xcmp == std::cmp::Ordering::Equal {
self.0.y.cmp(&other.0.y)
} else {
xcmp
})
}
}
}
impl std::cmp::PartialOrd for NavNode {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/core/physics/collisions/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ impl std::hash::Hash for ColliderShape {

impl PartialOrd for ColliderShape {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for ColliderShape {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
use ordered_float::OrderedFloat as F;
use std::cmp::Ordering::*;

Some(match self {
match self {
ColliderShape::Circle { diameter: r1 } => match other {
ColliderShape::Circle { diameter: r2 } => F(*r1).cmp(&F(*r2)),
ColliderShape::Rectangle { .. } => Less,
Expand All @@ -113,11 +118,6 @@ impl PartialOrd for ColliderShape {
}
ColliderShape::Circle { .. } => Greater,
},
})
}
}
impl Ord for ColliderShape {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.partial_cmp(other).unwrap()
}
}
}
10 changes: 5 additions & 5 deletions src/ui/main_menu/player_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn player_select_panel(
// If the handle is empty
if *player_handle == default() {
// Select the first player
*player_handle = meta.core.players[0].clone();
*player_handle = meta.core.players[0];
}

// Handle player joining
Expand Down Expand Up @@ -390,7 +390,7 @@ fn player_select_panel(
.map(|x| if x == 0 { None } else { Some(x - 1) })
.unwrap_or(Some(meta.core.player_hats.len() - 1))
};
slot.selected_hat = next_idx.map(|idx| meta.core.player_hats.get(idx).unwrap().clone());
slot.selected_hat = next_idx.map(|idx| *meta.core.player_hats.get(idx).unwrap());

// #[cfg(not(target_arch = "wasm32"))]
// if let Some(socket) = &params.network_socket {
Expand Down Expand Up @@ -418,7 +418,7 @@ fn player_select_panel(
.players
.get(current_player_handle_idx + 1)
.cloned()
.unwrap_or_else(|| meta.core.players[0].clone());
.unwrap_or_else(|| meta.core.players[0]);
} else if direction.x <= 0.0 {
if current_player_handle_idx > 0 {
*player_handle = meta
Expand All @@ -428,7 +428,7 @@ fn player_select_panel(
.cloned()
.unwrap();
} else {
*player_handle = meta.core.players.iter().last().unwrap().clone();
*player_handle = *meta.core.players.iter().last().unwrap();
}
}

Expand Down Expand Up @@ -607,7 +607,7 @@ fn player_select_panel(
slot.active = true;
let rand_idx =
THREAD_RNG.with(|rng| rng.usize(0..meta.core.players.len()));
slot.selected_player = meta.core.players[rand_idx].clone();
slot.selected_player = meta.core.players[rand_idx];
}
}
});
Expand Down

0 comments on commit b4d1dc6

Please sign in to comment.