@@ -64,10 +64,10 @@ use std::io::{BufRead, BufReader, BufWriter, Result, Write};
64
64
use std:: marker:: PhantomData ;
65
65
use std:: path:: Path ;
66
66
67
- /// A type alias for an [`Iter `] on a buffered file object.
67
+ /// A type alias for an [`JsonLinesIter `] on a buffered file object.
68
68
///
69
69
/// This is the return type of [`json_lines()`].
70
- pub type JsonLinesIter < T > = Iter < BufReader < File > , T > ;
70
+ pub type JsonLinesFileIter < T > = JsonLinesIter < BufReader < File > , T > ;
71
71
72
72
/// A structure for writing JSON values as JSON Lines.
73
73
///
@@ -298,8 +298,8 @@ impl<R> JsonLinesReader<R> {
298
298
/// Note that all deserialized values will be of the same type. If you
299
299
/// wish to read lines of varying types, use the
300
300
/// [`read()`][JsonLinesReader::read] method instead.
301
- pub fn read_all < T > ( self ) -> Iter < R , T > {
302
- Iter {
301
+ pub fn read_all < T > ( self ) -> JsonLinesIter < R , T > {
302
+ JsonLinesIter {
303
303
reader : self ,
304
304
_output : PhantomData ,
305
305
}
@@ -342,15 +342,15 @@ impl<R: BufRead> JsonLinesReader<R> {
342
342
/// This iterator yields items of type `Result<T, std::io::Error>`. Errors
343
343
/// occurr under the same conditions as for [`JsonLinesReader::read()`].
344
344
///
345
- /// Iterators of this type are returned by [`JsonLinesReader::iter ()`],
345
+ /// Iterators of this type are returned by [`JsonLinesReader::read_all ()`],
346
346
/// [`BufReadExt::json_lines()`], and [`json_lines()`].
347
347
#[ derive( Debug ) ]
348
- pub struct Iter < R , T > {
348
+ pub struct JsonLinesIter < R , T > {
349
349
reader : JsonLinesReader < R > ,
350
350
_output : PhantomData < T > ,
351
351
}
352
352
353
- impl < R , T > Iterator for Iter < R , T >
353
+ impl < R , T > Iterator for JsonLinesIter < R , T >
354
354
where
355
355
T : DeserializeOwned ,
356
356
R : BufRead ,
@@ -503,7 +503,7 @@ pub trait BufReadExt: BufRead {
503
503
/// [`JsonLinesReader::read()`].
504
504
///
505
505
/// Note that all deserialized values will be of the same type.
506
- fn json_lines < T > ( self ) -> Iter < Self , T >
506
+ fn json_lines < T > ( self ) -> JsonLinesIter < Self , T >
507
507
where
508
508
Self : Sized ,
509
509
{
@@ -729,7 +729,7 @@ where
729
729
/// }
730
730
/// ```
731
731
732
- pub fn json_lines < T , P : AsRef < Path > > ( path : P ) -> Result < JsonLinesIter < T > > {
732
+ pub fn json_lines < T , P : AsRef < Path > > ( path : P ) -> Result < JsonLinesFileIter < T > > {
733
733
let fp = BufReader :: new ( File :: open ( path) ?) ;
734
734
Ok ( fp. json_lines ( ) )
735
735
}
0 commit comments