aboutsummaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-07-29 10:23:06 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-07-29 10:23:06 -0700
commitdd109bc9e9b8a6a5585e8bf1093ec84dcad61309 (patch)
tree35dce7c6c595cdc415f478a1bd7d5290ad221205 /src/decoder
parent456cd1c7aa86896b0e87a7a995eefcd65ef79b01 (diff)
downloadmilf-rs-dd109bc9e9b8a6a5585e8bf1093ec84dcad61309.tar.gz
milf-rs-dd109bc9e9b8a6a5585e8bf1093ec84dcad61309.zip
Touch up the encoder/decoder a bit
* Whitespace things * Don't make `State` public * Remove `#[cfg]` annotations
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/mod.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs
index 9720528..51a9ea2 100644
--- a/src/decoder/mod.rs
+++ b/src/decoder/mod.rs
@@ -1,9 +1,7 @@
use std::error;
use std::fmt;
-#[cfg(feature = "rustc-serialize")]
use std::collections::{btree_map, BTreeMap};
-#[cfg(feature = "rustc-serialize")]
use std::iter::Peekable;
use Value;
@@ -22,9 +20,11 @@ pub struct Decoder {
/// whether fields were decoded or not.
pub toml: Option<Value>,
cur_field: Option<String>,
- #[cfg(feature = "rustc-serialize")]
+
+ // These aren't used if serde is in use
+ #[cfg_attr(feature = "serde", allow(dead_code))]
cur_map: Peekable<btree_map::IntoIter<String, Value>>,
- #[cfg(feature = "rustc-serialize")]
+ #[cfg_attr(feature = "serde", allow(dead_code))]
leftover_map: ::Table,
}
@@ -135,7 +135,6 @@ impl Decoder {
Decoder::new_empty(toml, cur_field)
}
- #[cfg(feature = "rustc-serialize")]
fn new_empty(toml: Option<Value>, cur_field: Option<String>) -> Decoder {
Decoder {
toml: toml,
@@ -145,14 +144,6 @@ impl Decoder {
}
}
- #[cfg(not(feature = "rustc-serialize"))]
- fn new_empty(toml: Option<Value>, cur_field: Option<String>) -> Decoder {
- Decoder {
- toml: toml,
- cur_field: cur_field,
- }
- }
-
fn err(&self, kind: DecodeErrorKind) -> DecodeError {
DecodeError {
field: self.cur_field.clone(),