Add pre-commit-config, run pre-commit on all files
This commit is contained in:
parent
50d07ffea5
commit
59963cdec1
8 changed files with 18 additions and 7 deletions
11
.pre-commit-config.yaml
Normal file
11
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
files: "\\.rs$"
|
||||
- id: end-of-file-fixer
|
||||
files: "\\.rs$"
|
||||
- id: mixed-line-ending
|
||||
args: [--fix=lf]
|
||||
files: "\\.rs$"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
pub mod engine;
|
||||
pub mod scene;
|
||||
pub mod debug_ui;
|
||||
pub use debug_ui::*;
|
||||
pub use debug_ui::*;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ impl EngineTrait for Engine {
|
|||
self.scene_manager.current_mut()
|
||||
}
|
||||
|
||||
fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>> {
|
||||
fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>> {
|
||||
self.debug_ui_buffer.clone()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
pub mod engine;
|
||||
pub mod system;
|
||||
|
||||
pub use crate::engine::Engine;
|
||||
pub use crate::engine::Engine;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ impl<E: EngineTrait<PlatformCtx = PlatformContext>> Platform<E> for GliumPlatfor
|
|||
.systems
|
||||
.values_mut()
|
||||
.for_each(|system| system.handle_event(&mut self.window, event.clone()));
|
||||
|
||||
|
||||
let mut ctx2 = ctx.clone();
|
||||
ctx2.current_event = event.clone();
|
||||
self.engine.handle_event(ctx2);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
mod basic;
|
||||
pub mod debug_ui;
|
||||
|
||||
pub use basic::BasicMeshRenderingSystem;
|
||||
pub use basic::BasicMeshRenderingSystem;
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ pub struct PlatformContext {
|
|||
pub asset_manager: ModelManagerRef,
|
||||
pub frame_width: f32,
|
||||
pub frame_height: f32,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ pub enum PlatformEvent {
|
|||
|
||||
/// The platform has requested to close the app.
|
||||
CloseRequested,
|
||||
|
||||
|
||||
/// Platform event loop is about to block and wait for new
|
||||
/// new events.
|
||||
AboutToWait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue