Skip to content

Commit

Permalink
Run rustfmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Sep 22, 2020
1 parent e204d37 commit 1ff64b3
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 35 deletions.
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#indent_style = "Block"
#where_single_line = true
#brace_style = "PreferSameLine"
2 changes: 1 addition & 1 deletion src/builtin/normals_material.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::camera::Camera;
use crate::context::Context;
use crate::light::Light;
use na::{Isometry3, Matrix3, Matrix4, Point3, Vector3};
use crate::resource::Material;
use crate::resource::{Effect, Mesh, ShaderAttribute, ShaderUniform};
use crate::scene::ObjectData;
use na::{Isometry3, Matrix3, Matrix4, Point3, Vector3};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/builtin/object_material.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::camera::Camera;
use crate::context::Context;
use crate::light::Light;
use na::{Isometry3, Matrix3, Matrix4, Point2, Point3, Vector3};
use crate::resource::Material;
use crate::resource::{Effect, Mesh, ShaderAttribute, ShaderUniform};
use crate::scene::ObjectData;
use na::{Isometry3, Matrix3, Matrix4, Point2, Point3, Vector3};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/builtin/planar_object_material.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::context::Context;
use na::{Isometry2, Matrix2, Matrix3, Point2, Point3, Vector2};
use crate::planar_camera::PlanarCamera;
use crate::resource::PlanarMaterial;
use crate::resource::{Effect, PlanarMesh, ShaderAttribute, ShaderUniform};
use crate::scene::PlanarObjectData;
use na::{Isometry2, Matrix2, Matrix3, Point2, Point3, Vector2};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/builtin/uvs_material.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::camera::Camera;
use crate::context::Context;
use crate::light::Light;
use na::{Isometry3, Matrix3, Matrix4, Point2, Point3, Vector3};
use crate::resource::Material;
use crate::resource::{Effect, Mesh, ShaderAttribute, ShaderUniform};
use crate::scene::ObjectData;
use na::{Isometry3, Matrix3, Matrix4, Point2, Point3, Vector3};

#[path = "../error.rs"]
mod error;
Expand Down
4 changes: 2 additions & 2 deletions src/camera/arc_ball.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::camera::Camera;
use crate::event::{Action, Key, Modifiers, MouseButton, WindowEvent};
use na::{self, Isometry3, Matrix4, Perspective3, Point3, Unit, UnitQuaternion, Vector2, Vector3};
use crate::resource::ShaderUniform;
use std::f32;
use crate::window::Canvas;
use na::{self, Isometry3, Matrix4, Perspective3, Point3, Unit, UnitQuaternion, Vector2, Vector3};
use std::f32;

/// Arc-ball camera mode.
///
Expand Down
2 changes: 1 addition & 1 deletion src/camera/camera.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::event::WindowEvent;
use na::{Isometry3, Matrix4, Point2, Point3, Point4, Vector2, Vector3};
use crate::resource::ShaderUniform;
use crate::window::Canvas;
use na::{Isometry3, Matrix4, Point2, Point3, Point4, Vector2, Vector3};

/// Trait every camera must implement.
pub trait Camera {
Expand Down
4 changes: 2 additions & 2 deletions src/camera/first_person.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::camera::Camera;
use crate::event::{Action, Key, MouseButton, WindowEvent};
use crate::resource::ShaderUniform;
use crate::window::Canvas;
use na::{
self, Isometry3, Matrix4, Perspective3, Point3, Translation3, Unit, UnitQuaternion, Vector2,
Vector3,
};
use num::Zero;
use crate::resource::ShaderUniform;
use std::f32;
use crate::window::Canvas;

/// First-person camera mode.
///
Expand Down
4 changes: 2 additions & 2 deletions src/camera/fixed_view.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::camera::Camera;
use crate::event::WindowEvent;
use na::{self, Isometry3, Matrix4, Perspective3, Point3};
use crate::resource::ShaderUniform;
use std::f32;
use crate::window::Canvas;
use na::{self, Isometry3, Matrix4, Perspective3, Point3};
use std::f32;

/// A camera that cannot move.
#[derive(Clone, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions src/loader/obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
use crate::loader::mtl;
use crate::loader::mtl::MtlMaterial;
use na::{Point2, Point3, Vector3};
use num::Bounded;
use crate::resource::GPUVec;
use crate::resource::{AllocationType, BufferType, Mesh};
use na::{Point2, Point3, Vector3};
use num::Bounded;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::fs::File;
Expand Down
4 changes: 2 additions & 2 deletions src/planar_camera/fixed_view.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::event::WindowEvent;
use na::{self, Matrix3, Point2, Vector2, Vector3};
use crate::planar_camera::PlanarCamera;
use crate::resource::ShaderUniform;
use std::f32;
use crate::window::Canvas;
use na::{self, Matrix3, Point2, Vector2, Vector3};
use std::f32;

/// A camera that cannot move.
#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/planar_camera/planar_camera.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::event::WindowEvent;
use na::{Matrix3, Point2, Vector2};
use crate::resource::ShaderUniform;
use crate::window::Canvas;
use na::{Matrix3, Point2, Vector2};

/// Trait every 2D camera must implement.
pub trait PlanarCamera {
Expand Down
6 changes: 3 additions & 3 deletions src/planar_camera/sidescroll.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::event::{Action, MouseButton, WindowEvent};
use na::{self, Matrix3, Point2, Translation2, Vector2};
use num::Pow;
use crate::planar_camera::PlanarCamera;
use crate::resource::ShaderUniform;
use std::f32;
use crate::window::Canvas;
use na::{self, Matrix3, Point2, Translation2, Vector2};
use num::Pow;
use std::f32;

/// A 2D camera that can be zoomed and panned.
#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/planar_line_renderer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! A batched line renderer.
use crate::context::Context;
use na::{Matrix3, Point2, Point3};
use crate::planar_camera::PlanarCamera;
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use na::{Matrix3, Point2, Point3};

#[path = "error.rs"]
mod error;
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/conrod_renderer.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! A renderer for Conrod primitives.
use crate::context::{Context, Texture};
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use crate::text::Font;
use conrod::position::Rect;
use conrod::text::GlyphCache;
use conrod::{render::PrimitiveKind, Ui};
use crate::context::{Context, Texture};
use na::{Point2, Point3, Point4, Vector2};
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use rusttype::gpu_cache::Cache;
use std::collections::HashMap;
use std::rc::Rc;
use crate::text::Font;

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/line_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
use crate::camera::Camera;
use crate::context::Context;
use na::{Matrix4, Point3};
use crate::renderer::Renderer;
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use na::{Matrix4, Point3};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/point_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
use crate::camera::Camera;
use crate::context::Context;
use na::{Matrix4, Point3};
use crate::renderer::Renderer;
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use na::{Matrix4, Point3};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/resource/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
use crate::camera::Camera;
use crate::light::Light;
use na::{Isometry2, Isometry3, Vector2, Vector3};
use crate::planar_camera::PlanarCamera;
use crate::resource::{Mesh, PlanarMesh};
use crate::scene::{ObjectData, PlanarObjectData};
use na::{Isometry2, Isometry3, Vector2, Vector3};

/// Trait implemented by materials.
pub trait Material {
Expand Down
4 changes: 2 additions & 2 deletions src/resource/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
use std::iter;
use std::sync::{Arc, RwLock};

use crate::resource::gpu_vector::{AllocationType, BufferType, GPUVec};
use crate::resource::ShaderAttribute;
use na::{self, Point2, Point3, Vector3};
use ncollide3d::procedural::{IndexBuffer, TriMesh};
use num::Zero;
use crate::resource::gpu_vector::{AllocationType, BufferType, GPUVec};
use crate::resource::ShaderAttribute;

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/resource/mesh_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
use crate::loader::mtl::MtlMaterial;
use crate::loader::obj;
use crate::resource::Mesh;
use ncollide3d::procedural;
use ncollide3d::procedural::TriMesh;
use crate::resource::Mesh;
use std::cell::RefCell;
use std::collections::HashMap;
use std::io::Result as IoResult;
Expand Down
4 changes: 3 additions & 1 deletion src/resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
pub use crate::context::Texture;
pub use crate::resource::effect::{Effect, ShaderAttribute, ShaderUniform};
pub use crate::resource::framebuffer_manager::{FramebufferManager, OffscreenBuffers, RenderTarget};
pub use crate::resource::framebuffer_manager::{
FramebufferManager, OffscreenBuffers, RenderTarget,
};
pub use crate::resource::gl_primitive::{GLPrimitive, PrimitiveArray};
pub use crate::resource::gpu_vector::{AllocationType, BufferType, GPUVec};
pub use crate::resource::material::{Material, PlanarMaterial};
Expand Down
2 changes: 1 addition & 1 deletion src/resource/planar_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
use std::iter;
use std::sync::{Arc, RwLock};

use na::{Point2, Point3};
use crate::resource::gpu_vector::{AllocationType, BufferType, GPUVec};
use crate::resource::ShaderAttribute;
use na::{Point2, Point3};

#[path = "../error.rs"]
mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/scene/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use crate::camera::Camera;
use crate::light::Light;
use na::{Isometry3, Point2, Point3, Vector3};
use crate::resource::{Material, Mesh, Texture, TextureManager};
use na::{Isometry3, Point2, Point3, Vector3};
use std::any::Any;
use std::cell::RefCell;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion src/scene/planar_object.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Data structure of a scene node.
use na::{Isometry2, Point2, Point3, Vector2};
use crate::planar_camera::PlanarCamera;
use crate::resource::{PlanarMaterial, PlanarMesh, Texture, TextureManager};
use na::{Isometry2, Point2, Point3, Vector2};
use std::any::Any;
use std::cell::RefCell;
use std::path::Path;
Expand Down
4 changes: 2 additions & 2 deletions src/scene/scene_node.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::camera::Camera;
use crate::light::Light;
use crate::resource::{Material, MaterialManager, Mesh, MeshManager, Texture, TextureManager};
use crate::scene::Object;
use na;
use na::{Isometry3, Point2, Point3, Translation3, UnitQuaternion, Vector3};
use ncollide3d::procedural;
use ncollide3d::procedural::TriMesh;
use crate::resource::{Material, MaterialManager, Mesh, MeshManager, Texture, TextureManager};
use crate::scene::Object;
use std::cell::{Ref, RefCell, RefMut};
use std::mem;
use std::path::{Path, PathBuf};
Expand Down

0 comments on commit 1ff64b3

Please sign in to comment.