aboutsummaryrefslogtreecommitdiff
path: root/src/decoder/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/mod.rs')
-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(),