Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Feb 6, 2024
1 parent f577c8f commit bf1747a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/datasets/log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl bench_prost::Serialize for Log {

#[inline]
fn serialize_pb(&self) -> Self::Message {
log_prost::Log{
log_prost::Log {
address: Some(self.address.serialize_pb()),
identity: self.identity.clone(),
userid: self.userid.clone(),
Expand Down Expand Up @@ -460,7 +460,9 @@ impl bench_prost::Serialize for Logs {
#[cfg(feature = "prost")]
impl From<log_prost::Logs> for Logs {
fn from(value: log_prost::Logs) -> Self {
Logs { logs: value.logs.into_iter().map(Into::into).collect() }
Logs {
logs: value.logs.into_iter().map(Into::into).collect(),
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/datasets/mesh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl bench_prost::Serialize for Vector3 {
#[cfg(feature = "prost")]
impl From<mesh_prost::Vector3> for Vector3 {
fn from(value: mesh_prost::Vector3) -> Self {
Vector3{
Vector3 {
x: value.x,
y: value.y,
z: value.z,
Expand Down Expand Up @@ -344,7 +344,9 @@ impl bench_prost::Serialize for Mesh {
#[cfg(feature = "prost")]
impl From<mesh_prost::Mesh> for Mesh {
fn from(value: mesh_prost::Mesh) -> Self {
Mesh { triangles: value.triangles.into_iter().map(Into::into).collect() }
Mesh {
triangles: value.triangles.into_iter().map(Into::into).collect(),
}
}
}

Expand Down
12 changes: 9 additions & 3 deletions src/datasets/minecraft_savedata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,9 @@ impl From<pb::Player> for Player {
fn from(value: pb::Player) -> Self {
Player {
game_type: pb::GameType::try_from(value.game_type).unwrap().into(),
previous_game_type: pb::GameType::try_from(value.previous_game_type).unwrap().into(),
previous_game_type: pb::GameType::try_from(value.previous_game_type)
.unwrap()
.into(),
score: value.score,
dimension: value.dimension,
selected_item_slot: value.selected_item_slot,
Expand All @@ -1349,7 +1351,9 @@ impl From<pb::Player> for Player {
ender_items: value.ender_items.into_iter().map(Into::into).collect(),
abilities: value.abilities.unwrap().into(),
entered_nether_position: value.entered_nether_position.map(Into::into),
root_vehicle: value.root_vehicle.map(|vehicle| (vehicle.uuid.unwrap().into(), vehicle.entity.unwrap().into())),
root_vehicle: value
.root_vehicle
.map(|vehicle| (vehicle.uuid.unwrap().into(), vehicle.entity.unwrap().into())),
shoulder_entity_left: value.shoulder_entity_left.map(Into::into),
shoulder_entity_right: value.shoulder_entity_right.map(Into::into),
seen_credits: value.seen_credits,
Expand Down Expand Up @@ -1529,7 +1533,9 @@ impl bench_prost::Serialize for Players {
#[cfg(feature = "prost")]
impl From<pb::Players> for Players {
fn from(value: pb::Players) -> Self {
Players { players: value.players.into_iter().map(Into::into).collect() }
Players {
players: value.players.into_iter().map(Into::into).collect(),
}
}
}

Expand Down
19 changes: 15 additions & 4 deletions src/datasets/mk48/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,18 @@ impl From<pb::Contact> for Contact {
Contact {
damage: value.damage.try_into().unwrap(),
entity_id: value.entity_id,
entity_type: value.entity_type.map(|et| <pb::EntityType>::try_from(et).unwrap().into()),
entity_type: value
.entity_type
.map(|et| <pb::EntityType>::try_from(et).unwrap().into()),
guidance: value.guidance.unwrap().into(),
player_id: value.player_id.map(|id| id.try_into().unwrap()),
reloads: value.reloads,
transform: value.transform.unwrap().into(),
turret_angles: value.turret_angles.into_iter().map(|a| a.try_into().unwrap()).collect(),
turret_angles: value
.turret_angles
.into_iter()
.map(|a| a.try_into().unwrap())
.collect(),
}
}
}
Expand Down Expand Up @@ -848,7 +854,10 @@ impl From<pb::ChunkId> for (i8, i8) {
#[cfg(feature = "prost")]
impl From<pb::TerrainUpdate> for TerrainUpdate {
fn from(value: pb::TerrainUpdate) -> Self {
TerrainUpdate { chunk_id: value.chunk_id.unwrap().into(), data: value.data }
TerrainUpdate {
chunk_id: value.chunk_id.unwrap().into(),
data: value.data,
}
}
}

Expand Down Expand Up @@ -1138,7 +1147,9 @@ impl bench_prost::Serialize for Updates {
#[cfg(feature = "prost")]
impl From<pb::Updates> for Updates {
fn from(value: pb::Updates) -> Self {
Updates { updates: value.updates.into_iter().map(Into::into).collect() }
Updates {
updates: value.updates.into_iter().map(Into::into).collect(),
}
}
}

Expand Down

0 comments on commit bf1747a

Please sign in to comment.