From 30e05bb3731f206bca98a7096cd8ddcd2fc32963 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 4 Sep 2022 22:21:24 -0700 Subject: [PATCH] cargo fmt --- examples/combat.rs | 6 ++++-- examples/conway.rs | 6 +++--- examples/cow_sphere.rs | 4 ++-- examples/raycast.rs | 4 ++-- examples/terrain.rs | 4 ++-- src/client/event.rs | 10 +++++----- src/lib.rs | 1 - 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/examples/combat.rs b/examples/combat.rs index fdf38de..d1f418c 100644 --- a/examples/combat.rs +++ b/examples/combat.rs @@ -3,7 +3,9 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use log::LevelFilter; use valence::block::{BlockPos, BlockState}; -use valence::client::{ClientEvent, ClientId, GameMode, InteractWithEntityKind, default_client_event}; +use valence::client::{ + default_client_event, ClientEvent, ClientId, GameMode, InteractWithEntityKind, +}; use valence::config::{Config, ServerListPing}; use valence::dimension::DimensionId; use valence::entity::{EntityEvent, EntityId, EntityKind}; @@ -270,4 +272,4 @@ impl Config for Game { } } } -} \ No newline at end of file +} diff --git a/examples/conway.rs b/examples/conway.rs index df3717d..e92e603 100644 --- a/examples/conway.rs +++ b/examples/conway.rs @@ -7,7 +7,7 @@ use num::Integer; use rayon::iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator}; use valence::biome::Biome; use valence::block::BlockState; -use valence::client::{ClientEvent, default_client_event}; +use valence::client::{default_client_event, ClientEvent}; use valence::config::{Config, ServerListPing}; use valence::dimension::{Dimension, DimensionId}; use valence::entity::types::Pose; @@ -49,7 +49,7 @@ struct ServerState { #[derive(Default)] struct ClientState { - entity_id: EntityId + entity_id: EntityId, } const MAX_PLAYERS: usize = 10; @@ -266,4 +266,4 @@ impl Config for Game { } } } -} \ No newline at end of file +} diff --git a/examples/cow_sphere.rs b/examples/cow_sphere.rs index aa5bca6..6e0f6be 100644 --- a/examples/cow_sphere.rs +++ b/examples/cow_sphere.rs @@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use log::LevelFilter; use valence::async_trait; use valence::block::{BlockPos, BlockState}; -use valence::client::{GameMode, default_client_event}; +use valence::client::{default_client_event, GameMode}; use valence::config::{Config, ServerListPing}; use valence::dimension::DimensionId; use valence::entity::{EntityId, EntityKind}; @@ -221,4 +221,4 @@ fn fibonacci_spiral(n: usize) -> impl Iterator> { let phi = (1.0 - 2.0 * y).acos(); Vec3::new(theta.cos() * phi.sin(), theta.sin() * phi.sin(), phi.cos()) }) -} \ No newline at end of file +} diff --git a/examples/raycast.rs b/examples/raycast.rs index f6f35a5..03fe9e3 100644 --- a/examples/raycast.rs +++ b/examples/raycast.rs @@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use log::LevelFilter; use valence::async_trait; use valence::block::{BlockPos, BlockState}; -use valence::client::{GameMode, default_client_event}; +use valence::client::{default_client_event, GameMode}; use valence::config::{Config, ServerListPing}; use valence::dimension::DimensionId; use valence::entity::{EntityId, EntityKind, TrackedData}; @@ -201,4 +201,4 @@ impl Config for Game { e.state = false; } } -} \ No newline at end of file +} diff --git a/examples/terrain.rs b/examples/terrain.rs index bfb6ef3..1ce7458 100644 --- a/examples/terrain.rs +++ b/examples/terrain.rs @@ -7,7 +7,7 @@ use rayon::iter::ParallelIterator; use valence::async_trait; use valence::block::{BlockState, PropName, PropValue}; use valence::chunk::ChunkPos; -use valence::client::{GameMode, default_client_event}; +use valence::client::{default_client_event, GameMode}; use valence::config::{Config, ServerListPing}; use valence::dimension::DimensionId; use valence::entity::{EntityId, EntityKind}; @@ -345,4 +345,4 @@ fn fbm(noise: &SuperSimplex, p: [f64; 3], octaves: u32, lacunarity: f64, persist fn noise01(noise: &SuperSimplex, xyz: [f64; 3]) -> f64 { (noise.get(xyz) + 1.0) / 2.0 -} \ No newline at end of file +} diff --git a/src/client/event.rs b/src/client/event.rs index b591233..2eaf90b 100644 --- a/src/client/event.rs +++ b/src/client/event.rs @@ -2,16 +2,15 @@ use std::time::Duration; use vek::Vec3; +use super::Client; use crate::block_pos::BlockPos; use crate::config::Config; use crate::entity::types::Pose; -use crate::entity::{EntityId, EntityEvent, Entity, TrackedData}; +use crate::entity::{Entity, EntityEvent, EntityId, TrackedData}; use crate::protocol::packets::c2s::play::BlockFace; pub use crate::protocol::packets::c2s::play::{ChatMode, DisplayedSkinParts, Hand, MainHand}; pub use crate::protocol::packets::s2c::play::GameMode; -use super::Client; - /// Represents an action performed by a client. /// /// Client events can be obtained from @@ -137,7 +136,8 @@ pub enum DiggingStatus { Finish, } -/// Standard client event handler that stores various things a player may do. Used to avoid extra boilerplate. +/// Standard client event handler that stores various things a player may do. +/// Used to avoid extra boilerplate. pub fn default_client_event( client: &mut Client, entity: &mut Entity, @@ -252,4 +252,4 @@ pub fn default_client_event( entity.set_world(client.world()); Some(event) -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index 5e24123..f207625 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,7 +65,6 @@ html_logo_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg" )] - #![forbid(unsafe_code)] #![warn( trivial_casts,