From 604f11a40f16c9ebafd11d496b9a5de01bb1d12d Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Tue, 27 Jun 2023 20:38:30 +0100 Subject: [PATCH] Implement Default for CameraUniform --- src/core/camera.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/camera.rs b/src/core/camera.rs index 716167c..1be8ea5 100644 --- a/src/core/camera.rs +++ b/src/core/camera.rs @@ -4,7 +4,6 @@ use winit::event::{ElementState, KeyboardInput, VirtualKeyCode, WindowEvent}; use crate::render::Context; -// TODO: Implement Default rather than using new() #[repr(C)] #[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] pub struct CameraUniform { @@ -14,6 +13,12 @@ pub struct CameraUniform { _pad: f32, } +impl Default for CameraUniform { + fn default() -> Self { + Self::new() + } +} + impl CameraUniform { pub fn new() -> Self { Self {