diff --git a/Cargo.toml b/Cargo.toml index ed5736a..a0dc494 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,9 @@ web-sys = "0.3.77" [dev-dependencies] insta = { version = "1.43.1", features = ["yaml"] } +[lints.clippy] +unnecessary_lazy_evaluations = "allow" + [profile.release] opt-level = 2 # fast and small wasm diff --git a/src/file_editor.rs b/src/file_editor.rs index ead3416..679e804 100644 --- a/src/file_editor.rs +++ b/src/file_editor.rs @@ -76,13 +76,13 @@ enum FileEvent { #[derive(serde::Deserialize, serde::Serialize)] pub enum BufferItem { - Text(MdTextEdit), + Text(Box), Handwriting(Box), } impl FileEditor { pub fn new(title: impl Into) -> Self { - let buffer = vec![BufferItem::Text(MdTextEdit::new())]; + let buffer = vec![BufferItem::Text(Box::new(MdTextEdit::new()))]; Self { title: title.into(), path: None, @@ -404,7 +404,7 @@ impl From<&str> for FileEditor { _ => { let mut text_edit = MdTextEdit::new(); text_edit.text.push_str(text); - buffer.push(BufferItem::Text(text_edit)); + buffer.push(BufferItem::Text(Box::new(text_edit))); } }; diff --git a/src/lib.rs b/src/lib.rs index a5e513d..ba1c882 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,3 @@ -#![warn(clippy::all, rust_2018_idioms)] - pub mod app; pub mod constants; pub mod custom_code_block; diff --git a/src/rasterizer.rs b/src/rasterizer.rs index 58cdfac..c0819a4 100644 --- a/src/rasterizer.rs +++ b/src/rasterizer.rs @@ -140,8 +140,7 @@ impl PxBoundingBox { } pub fn is_disjoint_from(&self, other: &PxBoundingBox) -> bool { - false - || self.x_from > other.x_to + self.x_from > other.x_to || self.y_from > other.y_to || other.x_from > self.x_to || other.y_from > self.y_to