mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Fix clippy warnings
This commit is contained in:
1 parent
97d69bd437
commit
91b57a3f28
3 files changed
+7
-18
No files matched your search
+2
-2
@@ -245,10 +245,10 @@ pub mod levenshtein {
|
|||||||
if a == b {
|
if a == b {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (b'A'..=b'Z').contains(&a) {
|
if a.is_ascii_uppercase() {
|
||||||
a += b'a' - b'A';
|
a += b'a' - b'A';
|
||||||
}
|
}
|
||||||
if (b'A'..=b'Z').contains(&b) {
|
if b.is_ascii_uppercase() {
|
||||||
b += b'a' - b'A';
|
b += b'a' - b'A';
|
||||||
}
|
}
|
||||||
if a == b {
|
if a == b {
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.67.1"
|
channel = "stable"
|
||||||
+4
-15
@@ -1879,8 +1879,9 @@ mod _io {
|
|||||||
write_through: bool,
|
write_through: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone, Default)]
|
||||||
enum Newlines {
|
enum Newlines {
|
||||||
|
#[default]
|
||||||
Universal,
|
Universal,
|
||||||
Passthrough,
|
Passthrough,
|
||||||
Lf,
|
Lf,
|
||||||
@@ -1888,13 +1889,6 @@ mod _io {
|
|||||||
Crlf,
|
Crlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Newlines {
|
|
||||||
#[inline]
|
|
||||||
fn default() -> Self {
|
|
||||||
Newlines::Universal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Newlines {
|
impl Newlines {
|
||||||
/// returns position where the new line starts if found, otherwise position at which to
|
/// returns position where the new line starts if found, otherwise position at which to
|
||||||
/// continue the search after more is read into the buffer
|
/// continue the search after more is read into the buffer
|
||||||
@@ -2054,8 +2048,9 @@ mod _io {
|
|||||||
data: PendingWritesData,
|
data: PendingWritesData,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default)]
|
||||||
enum PendingWritesData {
|
enum PendingWritesData {
|
||||||
|
#[default]
|
||||||
None,
|
None,
|
||||||
One(PendingWrite),
|
One(PendingWrite),
|
||||||
Many(Vec<PendingWrite>),
|
Many(Vec<PendingWrite>),
|
||||||
@@ -2076,12 +2071,6 @@ mod _io {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PendingWritesData {
|
|
||||||
fn default() -> Self {
|
|
||||||
PendingWritesData::None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PendingWrites {
|
impl PendingWrites {
|
||||||
fn push(&mut self, write: PendingWrite) {
|
fn push(&mut self, write: PendingWrite) {
|
||||||
self.num_bytes += write.as_bytes().len();
|
self.num_bytes += write.as_bytes().len();
|
||||||
|
|||||||
Reference in new issue
Block a user