Skip to content

Commit ad81fbc

Browse files
committed
cargo-fmt
1 parent 9cf6b99 commit ad81fbc

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

crates/bevy_render/src/mesh/mesh/conversions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
//! ```
2727
2828
use crate::mesh::VertexAttributeValues;
29+
use bevy_math::{Vec2, Vec3, Vec4};
2930
use bevy_utils::EnumVariantMeta;
3031
use std::convert::TryFrom;
3132
use thiserror::Error;
32-
use bevy_math::{Vec3, Vec2, Vec4};
3333
#[derive(Debug, Clone, Error)]
3434
#[error("cannot convert VertexAttributeValues::{variant} to {into}")]
3535
pub struct FromVertexAttributeError {
@@ -128,19 +128,19 @@ impl From<Vec<[u8; 4]>> for VertexAttributeValues {
128128

129129
impl From<Vec<Vec4>> for VertexAttributeValues {
130130
fn from(vec: Vec<Vec4>) -> Self {
131-
VertexAttributeValues::Float32x4(bytemuck::allocation::cast_vec(vec) )
131+
VertexAttributeValues::Float32x4(bytemuck::allocation::cast_vec(vec))
132132
}
133133
}
134134

135135
impl From<Vec<Vec3>> for VertexAttributeValues {
136136
fn from(vec: Vec<Vec3>) -> Self {
137-
VertexAttributeValues::Float32x3(bytemuck::allocation::cast_vec(vec) )
137+
VertexAttributeValues::Float32x3(bytemuck::allocation::cast_vec(vec))
138138
}
139139
}
140140

141141
impl From<Vec<Vec2>> for VertexAttributeValues {
142142
fn from(vec: Vec<Vec2>) -> Self {
143-
VertexAttributeValues::Float32x2(bytemuck::allocation::cast_vec(vec) )
143+
VertexAttributeValues::Float32x2(bytemuck::allocation::cast_vec(vec))
144144
}
145145
}
146146

examples/3d/custom_mesh.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use bevy::render::mesh::Indices;
21
use bevy::prelude::*;
2+
use bevy::render::mesh::Indices;
33
use bevy::render::pipeline::PrimitiveTopology;
44

55
fn main() {
@@ -20,26 +20,16 @@ fn setup(
2020
let right = Vec3::new(1.0, 0.0, 0.0);
2121
let up = Vec3::new(0.0, 1.0, 0.0);
2222

23-
let positions = vec![
24-
origin + up,
25-
origin + up + right,
26-
origin,
27-
origin + right,
28-
];
23+
let positions = vec![origin + up, origin + up + right, origin, origin + right];
2924

3025
let origin = Vec2::new(0.0, 0.0);
3126
let right = Vec2::new(1.0, 0.0);
3227
let up = Vec2::new(0.0, 1.0);
3328

34-
let uvs = vec![
35-
origin + up,
36-
origin + up + right,
37-
origin,
38-
origin + right,
39-
];
29+
let uvs = vec![origin + up, origin + up + right, origin, origin + right];
4030

41-
let normals = vec![ [0.0, 0.0, 1.0]; 4 ];
42-
let indices = Indices::U32(vec![0,1,2,3,2,1]);
31+
let normals = vec![[0.0, 0.0, 1.0]; 4];
32+
let indices = Indices::U32(vec![0, 1, 2, 3, 2, 1]);
4333

4434
let mut mesh = Mesh::new(PrimitiveTopology::TriangleList);
4535
mesh.set_indices(Some(indices));
@@ -53,7 +43,7 @@ fn setup(
5343
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
5444
..Default::default()
5545
});
56-
46+
5747
// light
5848
commands.spawn_bundle(PointLightBundle {
5949
transform: Transform::from_xyz(4.0, 8.0, 4.0),

0 commit comments

Comments
 (0)