Skip to content

Commit 9bac6fd

Browse files
committed
make Plot::default() behave like Plot::new()
Closes #380 Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
1 parent f68ea92 commit 9bac6fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plotly/src/plot.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Traces {
156156
/// Ok(())
157157
/// }
158158
/// ```
159-
#[derive(Default, Serialize, Clone)]
159+
#[derive(Serialize, Clone)]
160160
pub struct Plot {
161161
#[serde(rename = "data")]
162162
traces: Traces,
@@ -169,6 +169,12 @@ pub struct Plot {
169169
js_scripts: String,
170170
}
171171

172+
impl Default for Plot {
173+
fn default() -> Self {
174+
Self::new()
175+
}
176+
}
177+
172178
impl Plot {
173179
/// Create a new `Plot`.
174180
pub fn new() -> Plot {

0 commit comments

Comments
 (0)