Ran cargo fmt, clippy fixes, suppressed some warns

I will start working on stack traces tonight and tomorrow.

We need to be able to 'unwind' by finding calling functions.
This commit is contained in:
2025-03-04 23:06:47 +00:00
parent 8704b5d249
commit d53661b9a0
25 changed files with 300 additions and 176 deletions
+13 -5
View File
@@ -1,6 +1,7 @@
use crate::serial_print;
use crate::arch::x86_64::drivers::keyboard::{KeyStroke, get_keystroke_async};
use crate::resources::font::Font;
use crate::serial_print;
use crate::serial_println;
use crate::std::application::frame::Frame;
use crate::std::application::render::RenderError;
use crate::std::application::window::Window;
@@ -9,7 +10,6 @@ use crate::std::ascii::Writer;
use crate::std::maths::geometry::Vec2;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use crate::serial_println;
pub struct Editor {
cursor_line: usize,
@@ -65,7 +65,10 @@ impl<'a> Editor {
writer.render_glyph(
&mut frame,
Vec2::new(col * width + Self::PADDING, line * height + Self::PADDING),
Vec2::new(
col * width + Self::PADDING,
line * height + Self::PADDING,
),
ch as u8,
scale,
)?;
@@ -157,7 +160,10 @@ impl<'a> Editor {
impl Application for Editor {
type Output = ();
async fn run(&mut self, _args: Vec<alloc::string::String>) -> Result<Self::Output, Error> {
async fn run(
&mut self,
_args: Vec<alloc::string::String>,
) -> Result<Self::Output, Error> {
self.window.set_dimensions(Vec2::new(1280, 800));
self.window.set_position(Vec2::new(0, 0));
self.window.open();
@@ -167,7 +173,9 @@ impl Application for Editor {
loop {
if let Err(_err) = self.render().and_then(|frame| frame.render()) {
// TODO: Handle error
return Err(Error::ApplicationFailed("Rendering failed".to_string()));
return Err(Error::ApplicationFailed(
"Rendering failed".to_string(),
));
}
let keystroke = get_keystroke_async().await;