From e4a45eee82ccff9a9960583fb12268fbbfe1b6da Mon Sep 17 00:00:00 2001 From: Caznix Date: Fri, 6 Dec 2024 16:57:52 -0500 Subject: [PATCH] apply clippy changes --- engine/src/core/renderer/ctx.rs | 2 +- engine/src/core/repl/commands.rs | 2 +- engine/src/core/repl/{repl.rs => exec.rs} | 0 engine/src/core/repl/mod.rs | 2 +- engine/src/main.rs | 4 ++-- engine/src/utils/logger.rs | 8 +++++++- 6 files changed, 12 insertions(+), 6 deletions(-) rename engine/src/core/repl/{repl.rs => exec.rs} (100%) diff --git a/engine/src/core/renderer/ctx.rs b/engine/src/core/renderer/ctx.rs index 88ff9ae..d2045d8 100644 --- a/engine/src/core/renderer/ctx.rs +++ b/engine/src/core/renderer/ctx.rs @@ -80,7 +80,7 @@ impl<'window> WgpuCtx<'window> { .device .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); { - let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + let rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: None, color_attachments: &[Some(wgpu::RenderPassColorAttachment { view: &view, diff --git a/engine/src/core/repl/commands.rs b/engine/src/core/repl/commands.rs index cf59b48..d41fe5f 100644 --- a/engine/src/core/repl/commands.rs +++ b/engine/src/core/repl/commands.rs @@ -4,7 +4,7 @@ use lazy_static::lazy_static; use parking_lot::Mutex; use super::COMMAND_LIST; -use crate::core::repl::repl::evaluate_command; +use crate::core::repl::exec::evaluate_command; const MAX_RECURSION_DEPTH: usize = 500; // increasing this value WILL cause a stack overflow. attempt at your own risk - // Caz diff --git a/engine/src/core/repl/repl.rs b/engine/src/core/repl/exec.rs similarity index 100% rename from engine/src/core/repl/repl.rs rename to engine/src/core/repl/exec.rs diff --git a/engine/src/core/repl/mod.rs b/engine/src/core/repl/mod.rs index ebafd40..6a935bc 100644 --- a/engine/src/core/repl/mod.rs +++ b/engine/src/core/repl/mod.rs @@ -1,5 +1,5 @@ pub mod commands; -pub mod repl; +pub mod exec; use std::{borrow::Borrow, collections::HashMap, sync::Arc}; diff --git a/engine/src/main.rs b/engine/src/main.rs index 1dc0458..4b2dc0e 100644 --- a/engine/src/main.rs +++ b/engine/src/main.rs @@ -28,10 +28,10 @@ async fn main() -> Result<()> { LOGGER.write_to_stdout(); - let shell_thread = tokio::task::spawn(async { core::repl::repl::handle_repl().await }); + let shell_thread = tokio::task::spawn(async { core::repl::exec::handle_repl().await }); core::init_renderer()?; - let _ = shell_thread.await??; + shell_thread.await??; Ok(()) } diff --git a/engine/src/utils/logger.rs b/engine/src/utils/logger.rs index bfe442d..b927556 100644 --- a/engine/src/utils/logger.rs +++ b/engine/src/utils/logger.rs @@ -14,6 +14,12 @@ pub struct DynamicLogger { pub writer: Arc>>, } +impl Default for DynamicLogger { + fn default() -> Self { + Self::new() + } +} + impl DynamicLogger { pub fn new() -> Self { Self { @@ -24,7 +30,7 @@ impl DynamicLogger { pub fn write_to_file(&self, file_path: &str) { let file = OpenOptions::new() .create(true) - .write(true) + .append(true) .open(file_path) .expect("Failed to open log file");