Skip to content

Commit 970b0eb

Browse files
committed
More renamings
1 parent 39aa65e commit 970b0eb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v0.3.0 (in development)
22
-----------------------
33
- Renamed `JsonLinesReader::iter()` to `read_all()`
4+
- Renamed `Iter` to `JsonLinesIter`, and renamed `JsonLinesIter` to
5+
`JsonLinesFileIter`
46

57
v0.2.0 (2022-10-29)
68
-------------------

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ use std::io::{BufRead, BufReader, BufWriter, Result, Write};
6464
use std::marker::PhantomData;
6565
use std::path::Path;
6666

67-
/// A type alias for an [`Iter`] on a buffered file object.
67+
/// A type alias for an [`JsonLinesIter`] on a buffered file object.
6868
///
6969
/// 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>;
7171

7272
/// A structure for writing JSON values as JSON Lines.
7373
///
@@ -298,8 +298,8 @@ impl<R> JsonLinesReader<R> {
298298
/// Note that all deserialized values will be of the same type. If you
299299
/// wish to read lines of varying types, use the
300300
/// [`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 {
303303
reader: self,
304304
_output: PhantomData,
305305
}
@@ -342,15 +342,15 @@ impl<R: BufRead> JsonLinesReader<R> {
342342
/// This iterator yields items of type `Result<T, std::io::Error>`. Errors
343343
/// occurr under the same conditions as for [`JsonLinesReader::read()`].
344344
///
345-
/// Iterators of this type are returned by [`JsonLinesReader::iter()`],
345+
/// Iterators of this type are returned by [`JsonLinesReader::read_all()`],
346346
/// [`BufReadExt::json_lines()`], and [`json_lines()`].
347347
#[derive(Debug)]
348-
pub struct Iter<R, T> {
348+
pub struct JsonLinesIter<R, T> {
349349
reader: JsonLinesReader<R>,
350350
_output: PhantomData<T>,
351351
}
352352

353-
impl<R, T> Iterator for Iter<R, T>
353+
impl<R, T> Iterator for JsonLinesIter<R, T>
354354
where
355355
T: DeserializeOwned,
356356
R: BufRead,
@@ -503,7 +503,7 @@ pub trait BufReadExt: BufRead {
503503
/// [`JsonLinesReader::read()`].
504504
///
505505
/// 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>
507507
where
508508
Self: Sized,
509509
{
@@ -729,7 +729,7 @@ where
729729
/// }
730730
/// ```
731731
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>> {
733733
let fp = BufReader::new(File::open(path)?);
734734
Ok(fp.json_lines())
735735
}

0 commit comments

Comments
 (0)