summaryrefslogtreecommitdiff
path: root/subplotlib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-11 08:02:37 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-11 08:13:39 +0200
commita5858f2dc142411d7acc5b4a9f84b786a5082eb5 (patch)
tree2115ecd5b0c121356693cbaefed13509e2e19dc3 /subplotlib
parentbef7aa273eef984c0ea49ffa3df61989e47af18e (diff)
downloadsubplot-a5858f2dc142411d7acc5b4a9f84b786a5082eb5.tar.gz
chore: tidy up minor issues found by clippy
Sponsored-by: author
Diffstat (limited to 'subplotlib')
-rw-r--r--subplotlib/helpers/subplotlib_context.rs11
-rw-r--r--subplotlib/src/steplibrary/datadir.rs7
2 files changed, 2 insertions, 16 deletions
diff --git a/subplotlib/helpers/subplotlib_context.rs b/subplotlib/helpers/subplotlib_context.rs
index b986ed2..c662c98 100644
--- a/subplotlib/helpers/subplotlib_context.rs
+++ b/subplotlib/helpers/subplotlib_context.rs
@@ -1,21 +1,12 @@
use std::collections::HashMap;
+#[derive(Default)]
struct Context {
counter: usize,
files: HashMap<String, SubplotDataFile>,
this_file: Option<SubplotDataFile>,
}
-impl Default for Context {
- fn default() -> Self {
- Self {
- counter: 0,
- files: HashMap::new(),
- this_file: None,
- }
- }
-}
-
impl Context {
fn remember_file(&mut self, name: &str, content: SubplotDataFile) {
self.files.insert(name.to_string(), content);
diff --git a/subplotlib/src/steplibrary/datadir.rs b/subplotlib/src/steplibrary/datadir.rs
index ab80d25..8aa6f00 100644
--- a/subplotlib/src/steplibrary/datadir.rs
+++ b/subplotlib/src/steplibrary/datadir.rs
@@ -10,6 +10,7 @@ use std::path::{Component, Path, PathBuf};
pub use crate::prelude::*;
+#[derive(Default)]
pub struct Datadir {
inner: Option<DatadirInner>,
}
@@ -18,12 +19,6 @@ pub struct DatadirInner {
base: tempfile::TempDir,
}
-impl Default for Datadir {
- fn default() -> Self {
- Self { inner: None }
- }
-}
-
impl ContextElement for Datadir {
fn created(&mut self, scenario: &Scenario) {
assert!(self.inner.is_none());