Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCrumpLeys committed Jun 20, 2024
1 parent 1ee95a7 commit 65a35f7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/valence_protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ mod tests {

#[derive(Encode, Decode, Packet, Debug)]
#[packet(id = 3, side = PacketSide::Clientbound)]
struct EmptyStruct {}
struct EmptyStruct;

#[derive(Encode, Decode, Packet, Debug)]
#[packet(id = 4, side = PacketSide::Clientbound)]
Expand Down
4 changes: 2 additions & 2 deletions crates/valence_protocol/src/velocity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ impl fmt::Display for Velocity {
#[cfg(test)]
#[test]
fn velocity_from_ms() {
let val_1 = Velocity::from_ms_f32([(); 3].map(|_| -3.3575)).0[0];
let val_2 = Velocity::from_ms_f64([(); 3].map(|_| -3.3575)).0[0];
let val_1 = Velocity::from_ms_f32([(); 3].map(|()| -3.3575)).0[0];
let val_2 = Velocity::from_ms_f64([(); 3].map(|()| -3.3575)).0[0];

assert_eq!(val_1, val_2);
assert_eq!(val_1, -1343);
Expand Down
2 changes: 1 addition & 1 deletion crates/valence_server/src/chunk_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod tests {
#[test]
fn chunk_view_contains() {
let view = ChunkView::new(ChunkPos::new(0, 0), 32);
let positions = BTreeSet::from_iter(view.iter());
let positions = view.iter().collect::<BTreeSet<_>>();

for z in -64..64 {
for x in -64..64 {
Expand Down
2 changes: 1 addition & 1 deletion crates/valence_spatial/src/bvh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<T: Bounded3D + Send + Sync> Bvh<T> {
}
}

pub fn rebuild(&mut self, leaves: impl IntoIterator<Item = T>) {
pub fn rebuild<I: IntoIterator<Item = T>>(&mut self, leaves: I) {
self.internal_nodes.clear();
self.leaf_nodes.clear();

Expand Down
2 changes: 1 addition & 1 deletion tools/playground/src/playground.template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn init_clients(
layer_id.0 = layer;
visible_chunk_layer.0 = layer;
visible_entity_layers.0.insert(layer);
pos.set([0.0, SPAWN_Y as f64 + 1.0, 0.0]);
pos.set([0.0, f64::from(SPAWN_Y) + 1.0, 0.0]);
*game_mode = GameMode::Creative;
}
}
Expand Down
4 changes: 2 additions & 2 deletions tools/stresser/src/stresser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub async fn make_session<'a>(params: &SessionParams<'a>) -> anyhow::Result<()>

match conn.try_read_buf(&mut read_buf) {
Ok(0) => return Err(io::Error::from(ErrorKind::UnexpectedEof).into()),
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) => return Err(e.into()),
Ok(_) => (),
};
Expand Down Expand Up @@ -143,7 +143,7 @@ pub async fn make_session<'a>(params: &SessionParams<'a>) -> anyhow::Result<()>

match conn.try_read_buf(&mut read_buf) {
Ok(0) => return Err(io::Error::from(ErrorKind::UnexpectedEof).into()),
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) if e.kind() == io::ErrorKind::WouldBlock => continue,
Err(e) => return Err(e.into()),
Ok(_) => (),
};
Expand Down

0 comments on commit 65a35f7

Please sign in to comment.