diff --git a/code_markup/src/slow_pool.rs b/code_markup/src/slow_pool.rs index d69e1a1a9c..2d6118ddd9 100644 --- a/code_markup/src/slow_pool.rs +++ b/code_markup/src/slow_pool.rs @@ -4,7 +4,7 @@ use crate::markup::nodes::MarkupNode; pub type MarkNodeId = usize; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct SlowPool { nodes: Vec, } @@ -69,9 +69,3 @@ impl fmt::Display for SlowPool { Ok(()) } } - -impl Default for SlowPool { - fn default() -> Self { - SlowPool { nodes: Vec::new() } - } -} diff --git a/editor/src/editor/code_lines.rs b/editor/src/editor/code_lines.rs index 4298c877f4..bd274b4f05 100644 --- a/editor/src/editor/code_lines.rs +++ b/editor/src/editor/code_lines.rs @@ -7,7 +7,7 @@ use crate::ui::util::slice_get_mut; use std::cmp::Ordering; use std::fmt; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct CodeLines { pub lines: Vec, pub nr_of_chars: usize, @@ -155,15 +155,6 @@ impl CodeLines { } } -impl Default for CodeLines { - fn default() -> Self { - CodeLines { - lines: Vec::new(), - nr_of_chars: 0, - } - } -} - impl Lines for CodeLines { fn get_line_ref(&self, line_nr: usize) -> UIResult<&str> { let line_string = slice_get(line_nr, &self.lines)?; diff --git a/editor/src/graphics/lowlevel/buffer.rs b/editor/src/graphics/lowlevel/buffer.rs index 723e5957ef..fb508b1ce3 100644 --- a/editor/src/graphics/lowlevel/buffer.rs +++ b/editor/src/graphics/lowlevel/buffer.rs @@ -17,7 +17,9 @@ pub struct QuadBufferBuilder { impl QuadBufferBuilder { pub fn new() -> Self { Self { - ..Default::default() + vertex_data: Vec::new(), + index_data: Vec::new(), + current_quad: 0, } } @@ -81,11 +83,7 @@ impl QuadBufferBuilder { impl Default for QuadBufferBuilder { fn default() -> Self { - Self { - vertex_data: Vec::new(), - index_data: Vec::new(), - current_quad: 0, - } + Self::new() } } diff --git a/editor/src/window/keyboard_input.rs b/editor/src/window/keyboard_input.rs index 4848337e00..71addc230a 100644 --- a/editor/src/window/keyboard_input.rs +++ b/editor/src/window/keyboard_input.rs @@ -1,4 +1,5 @@ -#[derive(Debug)] +// note: the Default is that these are all False +#[derive(Debug, Default)] pub struct Modifiers { pub shift: bool, pub ctrl: bool, @@ -6,17 +7,6 @@ pub struct Modifiers { pub logo: bool, } -impl Default for Modifiers { - fn default() -> Self { - Self { - shift: false, - ctrl: false, - alt: false, - logo: false, - } - } -} - impl Modifiers { pub fn cmd_or_ctrl(&self) -> bool { #[cfg(target_os = "macos")]