aboutsummaryrefslogtreecommitdiff
path: root/src/encoder/mod.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-06-05 07:46:17 +0200
committerAlex Crichton <alex@alexcrichton.com>2016-06-05 07:46:17 +0200
commitfb8050d2d556dd613971f15e7bd73cfd43acad82 (patch)
treeeaae854e5e6d5b61e9039d30217f821a8a2f30f7 /src/encoder/mod.rs
parent7363dbe7f599a2373e6e2a749f51c76469dabdcf (diff)
parente8097b14f1ea246bf97af380670c502ba1517f30 (diff)
downloadmilf-rs-fb8050d2d556dd613971f15e7bd73cfd43acad82.tar.gz
milf-rs-fb8050d2d556dd613971f15e7bd73cfd43acad82.zip
Merge pull request #101 from leodasvacas/clippy-run
Clippy run and implement Default for State and Enconder
Diffstat (limited to 'src/encoder/mod.rs')
-rw-r--r--src/encoder/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs
index fb628fa..304bac6 100644
--- a/src/encoder/mod.rs
+++ b/src/encoder/mod.rs
@@ -35,6 +35,7 @@ use {Value, Table};
/// assert_eq!(e.toml.get(&"foo".to_string()), Some(&Value::Integer(4)))
/// # }
/// ```
+#[derive(Default)]
pub struct Encoder {
/// Output TOML that is emitted. The current version of this encoder forces
/// the top-level representation of a structure to be a table.
@@ -73,6 +74,10 @@ enum State {
NextMapKey,
}
+impl Default for State {
+ fn default() -> State { State::Start }
+}
+
impl Encoder {
/// Constructs a new encoder which will emit to the given output stream.
pub fn new() -> Encoder {