Skip to content

Commit b314b80

Browse files
committed
appease clippy
1 parent 95c4bc9 commit b314b80

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

plotly/src/common/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,22 +1352,17 @@ impl Label {
13521352
}
13531353
}
13541354

1355-
#[derive(Serialize, Clone, Debug)]
1355+
#[derive(Serialize, Clone, Debug, Default)]
13561356
#[serde(rename_all = "lowercase")]
13571357
pub enum ErrorType {
1358+
#[default]
13581359
Percent,
13591360
Constant,
13601361
#[serde(rename = "sqrt")]
13611362
SquareRoot,
13621363
Data,
13631364
}
13641365

1365-
impl Default for ErrorType {
1366-
fn default() -> Self {
1367-
ErrorType::Percent
1368-
}
1369-
}
1370-
13711366
#[serde_with::skip_serializing_none]
13721367
#[derive(Serialize, Clone, Debug, Default)]
13731368
pub struct ErrorData {

plotly_derive/src/field_setter.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ pub(crate) fn field_setter_impl(input: DeriveInput) -> proc_macro::TokenStream {
2020
.into()
2121
}
2222

23-
#[derive(Debug, Clone, Copy, FromMeta)]
23+
#[derive(Debug, Clone, Copy, FromMeta, Default)]
2424
#[darling(default)]
2525
enum Kind {
26+
#[default]
2627
Other,
2728
Layout,
2829
Trace,
@@ -38,12 +39,6 @@ impl Kind {
3839
}
3940
}
4041

41-
impl Default for Kind {
42-
fn default() -> Self {
43-
Kind::Other
44-
}
45-
}
46-
4742
#[derive(Debug, FromDeriveInput)]
4843
#[darling(attributes(field_setter), supports(struct_named))]
4944
struct StructReceiver {

0 commit comments

Comments
 (0)