diff options
Diffstat (limited to 'src/encoder/mod.rs')
-rw-r--r-- | src/encoder/mod.rs | 5 |
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 { |