Fix clippy warnings

This commit is contained in:
Jeong YunWon
2023-03-10 02:01:18 +09:00
parent 97d69bd437
commit 91b57a3f28
3 changed files with 7 additions and 18 deletions

View File

@@ -245,10 +245,10 @@ pub mod levenshtein {
if a == b {
return 0;
}
if (b'A'..=b'Z').contains(&a) {
if a.is_ascii_uppercase() {
a += b'a' - b'A';
}
if (b'A'..=b'Z').contains(&b) {
if b.is_ascii_uppercase() {
b += b'a' - b'A';
}
if a == b {

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "1.67.1"
channel = "stable"

View File

@@ -1879,8 +1879,9 @@ mod _io {
write_through: bool,
}
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Copy, Clone, Default)]
enum Newlines {
#[default]
Universal,
Passthrough,
Lf,
@@ -1888,13 +1889,6 @@ mod _io {
Crlf,
}
impl Default for Newlines {
#[inline]
fn default() -> Self {
Newlines::Universal
}
}
impl Newlines {
/// returns position where the new line starts if found, otherwise position at which to
/// continue the search after more is read into the buffer
@@ -2054,8 +2048,9 @@ mod _io {
data: PendingWritesData,
}
#[derive(Debug)]
#[derive(Debug, Default)]
enum PendingWritesData {
#[default]
None,
One(PendingWrite),
Many(Vec<PendingWrite>),
@@ -2076,12 +2071,6 @@ mod _io {
}
}
impl Default for PendingWritesData {
fn default() -> Self {
PendingWritesData::None
}
}
impl PendingWrites {
fn push(&mut self, write: PendingWrite) {
self.num_bytes += write.as_bytes().len();