diff --git a/src/iterator.rs b/src/iter.rs similarity index 94% rename from src/iterator.rs rename to src/iter.rs index f8d8099a..508ebad1 100644 --- a/src/iterator.rs +++ b/src/iter.rs @@ -1,7 +1,7 @@ use std::io; pub struct LineColIterator>> { - rdr: Iter, + iter: Iter, line: usize, col: usize, } @@ -9,9 +9,9 @@ pub struct LineColIterator>> { impl>> LineColIterator { pub fn new(iter: Iter) -> LineColIterator { LineColIterator { + iter: iter, line: 1, col: 0, - rdr: iter, } } @@ -34,7 +34,7 @@ impl>> LineColIterator { impl>> Iterator for LineColIterator { type Item = io::Result; fn next(&mut self) -> Option> { - match self.rdr.next() { + match self.iter.next() { None => None, Some(Ok(b'\n')) => { self.line += 1; diff --git a/src/json/de.rs b/src/json/de.rs index 2e978f2d..6f55b6b8 100644 --- a/src/json/de.rs +++ b/src/json/de.rs @@ -3,8 +3,9 @@ use std::io; use std::str; use de; +use iter::LineColIterator; + use super::error::{Error, ErrorCode}; -use iterator::LineColIterator; pub struct Deserializer>> { rdr: LineColIterator, diff --git a/src/lib.rs b/src/lib.rs index cac66ca4..9c31fc55 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,8 +12,8 @@ extern crate num; pub use ser::{Serialize, Serializer}; pub use de::{Deserialize, Deserializer, Error}; -pub mod ser; -pub mod de; -pub mod json; pub mod bytes; -mod iterator; +pub mod de; +pub mod iter; +pub mod json; +pub mod ser;