From aca5d4b4c76a51fccb7d767b2d6d147e2edc0850 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Thu, 15 Aug 2024 08:24:44 -0400 Subject: [PATCH] fix typos --- csv-core/src/reader.rs | 6 +++--- src/error.rs | 2 +- src/reader.rs | 4 ++-- src/writer.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/csv-core/src/reader.rs b/csv-core/src/reader.rs index dbd6dc3..2280874 100644 --- a/csv-core/src/reader.rs +++ b/csv-core/src/reader.rs @@ -339,7 +339,7 @@ pub enum ReadRecordResult { /// The caller provided output buffer was filled before an entire field /// could be written to it. OutputFull, - /// The caller provided output buffer of field end poisitions was filled + /// The caller provided output buffer of field end positions was filled /// before the next field could be parsed. OutputEndsFull, /// The end of a record was found. @@ -1077,7 +1077,7 @@ impl Reader { /// The number of transition classes is determined by an equivalence class of /// bytes, where every byte in the same equivalence classes is /// indistinguishable from any other byte with respect to the DFA. For example, -/// if neither `a` nor `b` are specifed as a delimiter/quote/terminator/escape, +/// if neither `a` nor `b` are specified as a delimiter/quote/terminator/escape, /// then the DFA will never discriminate between `a` or `b`, so they can /// effectively be treated as identical. This reduces storage space /// substantially. @@ -1902,7 +1902,7 @@ mod tests { assert_read!(rdr, b("\"foo"), out, 4, 3, InputEmpty); assert_eq!(&out[..3], b("foo")); - // Without reseting the parser state, the reader will remember that + // Without resetting the parser state, the reader will remember that // we're in a quoted field, and therefore interpret the leading double // quotes below as a single quote and the trailing quote as a matching // terminator. With the reset, however, the parser forgets the quoted diff --git a/src/error.rs b/src/error.rs index 1dfe304..dfbe813 100644 --- a/src/error.rs +++ b/src/error.rs @@ -60,7 +60,7 @@ impl Error { pub enum ErrorKind { /// An I/O error that occurred while reading CSV data. Io(io::Error), - /// A UTF-8 decoding error that occured while reading CSV data into Rust + /// A UTF-8 decoding error that occurred while reading CSV data into Rust /// `String`s. Utf8 { /// The position of the record in which this error occurred, if diff --git a/src/reader.rs b/src/reader.rs index 82f5d2c..fd4ceda 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -1497,7 +1497,7 @@ impl Reader { /// default), then this will never read the first record. /// /// This method is useful when you want to read records as fast as - /// as possible. It's less ergonomic than an iterator, but it permits the + /// possible. It's less ergonomic than an iterator, but it permits the /// caller to reuse the `StringRecord` allocation, which usually results /// in higher throughput. /// @@ -2253,7 +2253,7 @@ mod tests { } #[test] - fn read_trimed_header_invalid_utf8() { + fn read_trimmed_header_invalid_utf8() { let data = &b"foo, b\xFFar,\tbaz\na,b,c\nd,e,f"[..]; let mut rdr = ReaderBuilder::new() .has_headers(true) diff --git a/src/writer.rs b/src/writer.rs index 9fef1f1..74152f2 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -1382,7 +1382,7 @@ mod tests { let got = wtr.into_inner().unwrap().to_str(); // As the buffer size is 4 we should write each record separately, and - // flush when explicitly called and implictly in into_inner. + // flush when explicitly called and implicitly in into_inner. assert_eq!(got, ">a,b\n<>c,d\ne,f\n