Fix clippy
This commit is contained in:
@ -48,6 +48,9 @@ web-sys = "0.3.77"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
insta = { version = "1.43.1", features = ["yaml"] }
|
insta = { version = "1.43.1", features = ["yaml"] }
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
unnecessary_lazy_evaluations = "allow"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 2 # fast and small wasm
|
opt-level = 2 # fast and small wasm
|
||||||
|
|
||||||
|
|||||||
@ -76,13 +76,13 @@ enum FileEvent {
|
|||||||
|
|
||||||
#[derive(serde::Deserialize, serde::Serialize)]
|
#[derive(serde::Deserialize, serde::Serialize)]
|
||||||
pub enum BufferItem {
|
pub enum BufferItem {
|
||||||
Text(MdTextEdit),
|
Text(Box<MdTextEdit>),
|
||||||
Handwriting(Box<Handwriting>),
|
Handwriting(Box<Handwriting>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileEditor {
|
impl FileEditor {
|
||||||
pub fn new(title: impl Into<String>) -> Self {
|
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 {
|
Self {
|
||||||
title: title.into(),
|
title: title.into(),
|
||||||
path: None,
|
path: None,
|
||||||
@ -404,7 +404,7 @@ impl From<&str> for FileEditor {
|
|||||||
_ => {
|
_ => {
|
||||||
let mut text_edit = MdTextEdit::new();
|
let mut text_edit = MdTextEdit::new();
|
||||||
text_edit.text.push_str(text);
|
text_edit.text.push_str(text);
|
||||||
buffer.push(BufferItem::Text(text_edit));
|
buffer.push(BufferItem::Text(Box::new(text_edit)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
#![warn(clippy::all, rust_2018_idioms)]
|
|
||||||
|
|
||||||
pub mod app;
|
pub mod app;
|
||||||
pub mod constants;
|
pub mod constants;
|
||||||
pub mod custom_code_block;
|
pub mod custom_code_block;
|
||||||
|
|||||||
@ -140,8 +140,7 @@ impl PxBoundingBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_disjoint_from(&self, other: &PxBoundingBox) -> bool {
|
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
|
|| self.y_from > other.y_to
|
||||||
|| other.x_from > self.x_to
|
|| other.x_from > self.x_to
|
||||||
|| other.y_from > self.y_to
|
|| other.y_from > self.y_to
|
||||||
|
|||||||
Reference in New Issue
Block a user