From 660d5ef1a84a4f3a54fcf6f9985a3cca58bd5fcf Mon Sep 17 00:00:00 2001 From: LukaOber Date: Mon, 28 Oct 2024 12:17:43 +0100 Subject: [PATCH 1/2] allow large_enum_variant --- charming/src/datatype/datapoint.rs | 1 + charming/src/element/mark_line.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/charming/src/datatype/datapoint.rs b/charming/src/datatype/datapoint.rs index c35ec5e..a42ad9d 100644 --- a/charming/src/datatype/datapoint.rs +++ b/charming/src/datatype/datapoint.rs @@ -74,6 +74,7 @@ where #[derive(Serialize, Debug, PartialEq, PartialOrd, Clone)] #[serde(untagged)] +#[allow(clippy::large_enum_variant)] pub enum DataPoint { Value(CompositeValue), Item(DataPointItem), diff --git a/charming/src/element/mark_line.rs b/charming/src/element/mark_line.rs index c655a61..8fe5729 100644 --- a/charming/src/element/mark_line.rs +++ b/charming/src/element/mark_line.rs @@ -131,6 +131,7 @@ impl From<(&str, &str)> for MarkLineData { } #[derive(Debug, PartialEq, PartialOrd, Clone)] +#[allow(clippy::large_enum_variant)] pub enum MarkLineVariant { Simple(MarkLineData), StartToEnd(MarkLineData, MarkLineData), From 5ee451e822d0a3137fe4b15705f3c1ef6eb7b93c Mon Sep 17 00:00:00 2001 From: LukaOber Date: Mon, 28 Oct 2024 12:28:53 +0100 Subject: [PATCH 2/2] fix upcoming lints --- charming/src/datatype/dataframe.rs | 1 - gallery/src/line/rainfall.rs | 6 +++--- gallery/src/line/rainfall_vs_evaporation.rs | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/charming/src/datatype/dataframe.rs b/charming/src/datatype/dataframe.rs index 39a4a8a..01f0392 100644 --- a/charming/src/datatype/dataframe.rs +++ b/charming/src/datatype/dataframe.rs @@ -73,7 +73,6 @@ macro_rules! df { /// Code below is modified (using df! as reference) from ChatGPT generated code. /// The main objective of macro dz! is to transpose mixed data type vectors, /// aka columns or dimensions into ECharts dataframe format. - #[macro_export] macro_rules! dz { /* diff --git a/gallery/src/line/rainfall.rs b/gallery/src/line/rainfall.rs index 426e265..01134d9 100644 --- a/gallery/src/line/rainfall.rs +++ b/gallery/src/line/rainfall.rs @@ -103,7 +103,7 @@ pub fn chart() -> Chart { ) } -const TIME: [&str; 3079] = [ +static TIME: [&str; 3079] = [ "2009/6/12\n2:00", "2009/6/12\n3:00", "2009/6/12\n4:00", @@ -3185,7 +3185,7 @@ const TIME: [&str; 3079] = [ "2009/10/18\n8:00", ]; -const FLOW_DATA: [f64; 3079] = [ +static FLOW_DATA: [f64; 3079] = [ 0.97, 0.96, 0.96, 0.95, 0.95, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, @@ -3387,7 +3387,7 @@ const FLOW_DATA: [f64; 3079] = [ 0.45, 0.45, 0.45, ]; -const RAINFALL_DATA: [f64; 3079] = [ +static RAINFALL_DATA: [f64; 3079] = [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.005, 0.017, 0.017, 0.017, 0.017, 0.011, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., diff --git a/gallery/src/line/rainfall_vs_evaporation.rs b/gallery/src/line/rainfall_vs_evaporation.rs index d3f9fd4..a7d6a72 100644 --- a/gallery/src/line/rainfall_vs_evaporation.rs +++ b/gallery/src/line/rainfall_vs_evaporation.rs @@ -105,7 +105,7 @@ pub fn chart() -> Chart { ) } -const TIME_DATA: [&str; 3079] = [ +static TIME_DATA: [&str; 3079] = [ "2009/6/12 2:00", "2009/6/12 3:00", "2009/6/12 4:00", @@ -3187,7 +3187,7 @@ const TIME_DATA: [&str; 3079] = [ "2009/10/18 8:00", ]; -const EVAPORATION_DATA: [f64; 3079] = [ +static EVAPORATION_DATA: [f64; 3079] = [ 0.97, 0.96, 0.96, 0.95, 0.95, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, @@ -3389,7 +3389,7 @@ const EVAPORATION_DATA: [f64; 3079] = [ 0.45, 0.45, 0.45, ]; -const RAINFALL_DATA: [f64; 3079] = [ +static RAINFALL_DATA: [f64; 3079] = [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.005, 0.017, 0.017, 0.017, 0.017, 0.011, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,