Fix clippy

This commit is contained in:
2025-07-11 15:24:35 +02:00
parent c59febd924
commit fe0b9d049e
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -76,13 +76,13 @@ enum FileEvent {
#[derive(serde::Deserialize, serde::Serialize)]
pub enum BufferItem {
Text(MdTextEdit),
Text(Box<MdTextEdit>),
Handwriting(Box<Handwriting>),
}
impl FileEditor {
pub fn new(title: impl Into<String>) -> 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)));
}
};

View File

@ -1,5 +1,3 @@
#![warn(clippy::all, rust_2018_idioms)]
pub mod app;
pub mod constants;
pub mod custom_code_block;

View File

@ -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