Skip to content

Commit 91b57a3

Browse files
committed
Fix clippy warnings
1 parent 97d69bd commit 91b57a3

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

common/src/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ pub mod levenshtein {
245245
if a == b {
246246
return 0;
247247
}
248-
if (b'A'..=b'Z').contains(&a) {
248+
if a.is_ascii_uppercase() {
249249
a += b'a' - b'A';
250250
}
251-
if (b'A'..=b'Z').contains(&b) {
251+
if b.is_ascii_uppercase() {
252252
b += b'a' - b'A';
253253
}
254254
if a == b {

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.67.1"
2+
channel = "stable"

vm/src/stdlib/io.rs

+4-15
Original file line numberDiff line numberDiff line change
@@ -1879,22 +1879,16 @@ mod _io {
18791879
write_through: bool,
18801880
}
18811881

1882-
#[derive(Debug, Copy, Clone)]
1882+
#[derive(Debug, Copy, Clone, Default)]
18831883
enum Newlines {
1884+
#[default]
18841885
Universal,
18851886
Passthrough,
18861887
Lf,
18871888
Cr,
18881889
Crlf,
18891890
}
18901891

1891-
impl Default for Newlines {
1892-
#[inline]
1893-
fn default() -> Self {
1894-
Newlines::Universal
1895-
}
1896-
}
1897-
18981892
impl Newlines {
18991893
/// returns position where the new line starts if found, otherwise position at which to
19001894
/// continue the search after more is read into the buffer
@@ -2054,8 +2048,9 @@ mod _io {
20542048
data: PendingWritesData,
20552049
}
20562050

2057-
#[derive(Debug)]
2051+
#[derive(Debug, Default)]
20582052
enum PendingWritesData {
2053+
#[default]
20592054
None,
20602055
One(PendingWrite),
20612056
Many(Vec<PendingWrite>),
@@ -2076,12 +2071,6 @@ mod _io {
20762071
}
20772072
}
20782073

2079-
impl Default for PendingWritesData {
2080-
fn default() -> Self {
2081-
PendingWritesData::None
2082-
}
2083-
}
2084-
20852074
impl PendingWrites {
20862075
fn push(&mut self, write: PendingWrite) {
20872076
self.num_bytes += write.as_bytes().len();

0 commit comments

Comments
 (0)