From 69032d583b56cf641465fd66c0cbe78a1ca7a908 Mon Sep 17 00:00:00 2001 From: Warlock Date: Sun, 8 Sep 2024 17:57:00 +0300 Subject: [PATCH] clippy --- Cargo.toml | 2 +- src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6043640..fe6e027 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "utf8-chars" -version = "3.0.3" +version = "3.0.4" rust-version = "1.70" authors = ["warlock "] description = "Char-by-char iterator and `read_char` method for `BufRead`." diff --git a/src/lib.rs b/src/lib.rs index 31fd84e..4383999 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,7 @@ use std::io::{self, BufRead}; use arrayvec::{ArrayVec}; /// A structure, containing read bytes, and an [`io::Error`]. +/// /// The `io::Error` is an actual I/O error if some occurred, /// or a synthetic error with either the [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) /// kind if a multi-byte char was unexpectedly terminated, @@ -64,6 +65,7 @@ impl fmt::Display for ReadCharError { } /// An iterator over the chars of an instance of [`BufRead`]. +/// /// In contrast to [`CharsRaw`], the error type is /// [`io::Error`], and therefore more likely to be drop-in /// compatible, at the price of losing the UTF-8 context bytes in the error @@ -120,6 +122,7 @@ fn read_byte_and_ignore_interrupts(reader: &mut (impl BufRead + ?Sized)) -> io:: /// Extends [`BufRead`] with methods for reading chars. pub trait BufReadCharsExt : BufRead { /// Returns an iterator over the chars of this reader. + /// /// In contrast to [`chars_raw`](BufReadCharsExt::chars_raw), the error type is /// [`io::Error`], and therefore more likely to be drop-in /// compatible, at the price of losing the UTF-8 context bytes in the error @@ -136,6 +139,7 @@ pub trait BufReadCharsExt : BufRead { fn chars_raw(&mut self) -> CharsRaw { CharsRaw(self) } /// Reads a char from the underlying reader. + /// /// In contrast to [`read_char_raw`](BufReadCharsExt::read_char_raw), the error type is /// [`io::Error`], and therefore more likely to be drop-in /// compatible, at the price of losing the UTF-8 context bytes in the error