Skip to content

Commit 174c026

Browse files
authored
Merge pull request #3817 from youknowone/fix-clippy
Fix nightly clippy warnings
2 parents a30a170 + fdab7e0 commit 174c026

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

Lib/test/test_strtod.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,8 @@ def test_bigcomp(self):
219219
s = '{}e{}'.format(digits, exponent)
220220
self.check_strtod(s)
221221

222-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, possibly flaky test on Windows?")
223222
# TODO: RUSTPYTHON, Incorrectly rounded str->float conversion for -07e-321
224-
@unittest.expectedFailure
223+
@unittest.skip("TODO: RUSTPYTHON; flaky test")
225224
def test_parsing(self):
226225
# make '0' more likely to be chosen than other digits
227226
digits = '000000123456789'

ast/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl std::fmt::Display for Constant {
7171
}
7272

7373
/// Transforms a value prior to formatting it.
74-
#[derive(Copy, Clone, Debug, PartialEq)]
74+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
7575
#[repr(u8)]
7676
pub enum ConversionFlag {
7777
/// Converts by calling `str(<value>)`.

ast/src/location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt;
44

55
/// A location somewhere in the sourcecode.
6-
#[derive(Clone, Copy, Debug, Default, PartialEq)]
6+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
77
pub struct Location {
88
row: usize,
99
column: usize,

bytecode/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
1313
use std::{collections::BTreeSet, fmt, hash};
1414

1515
/// Sourcecode location.
16-
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
16+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
1717
pub struct Location {
1818
row: u32,
1919
column: u32,
@@ -158,7 +158,7 @@ impl fmt::Display for Label {
158158
}
159159

160160
/// Transforms a value prior to formatting it.
161-
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
161+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
162162
pub enum ConversionFlag {
163163
/// No conversion
164164
None,
@@ -171,7 +171,7 @@ pub enum ConversionFlag {
171171
}
172172

173173
/// The kind of Raise that occurred.
174-
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
174+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
175175
pub enum RaiseKind {
176176
Reraise,
177177
Raise,
@@ -181,7 +181,7 @@ pub enum RaiseKind {
181181
pub type NameIdx = u32;
182182

183183
/// A Single bytecode instruction.
184-
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
184+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
185185
pub enum Instruction {
186186
/// Importing by name
187187
ImportName {
@@ -582,7 +582,7 @@ pub enum TestOperator {
582582
/// use rustpython_bytecode::BinaryOperator::Add;
583583
/// let op = BinaryOperation {op: Add};
584584
/// ```
585-
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
585+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
586586
pub enum BinaryOperator {
587587
Power,
588588
Multiply,
@@ -600,7 +600,7 @@ pub enum BinaryOperator {
600600
}
601601

602602
/// The possible unary operators
603-
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
603+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
604604
pub enum UnaryOperator {
605605
Not,
606606
Invert,

common/src/encodings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ where
7373
}
7474
// we need to coerce the lifetime to that of the function body rather than the
7575
// anonymous input lifetime, so that we can assign it data borrowed from data_from_err
76-
let mut data = &*data;
76+
let mut data = data;
7777
let mut data_from_err: E::BytesBuf;
7878
let mut out = String::with_capacity(data.len());
7979
let mut remaining_index = 0;

compiler/src/symboltable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl SymbolTable {
6262
}
6363
}
6464

65-
#[derive(Debug, Clone, Copy, PartialEq)]
65+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6666
pub enum SymbolTableType {
6767
Module,
6868
Class,
@@ -83,7 +83,7 @@ impl fmt::Display for SymbolTableType {
8383

8484
/// Indicator for a single symbol what the scope of this symbol is.
8585
/// The scope can be unknown, which is unfortunate, but not impossible.
86-
#[derive(Debug, Clone, Copy, PartialEq)]
86+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8787
pub enum SymbolScope {
8888
Unknown,
8989
Local,

jit/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl JitSig {
163163
}
164164
}
165165

166-
#[derive(Debug, Clone, PartialEq)]
166+
#[derive(Debug, Clone, PartialEq, Eq)]
167167
#[non_exhaustive]
168168
pub enum JitType {
169169
Int,

vm/src/builtins/mappingproxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl PyMappingProxy {
9191
MappingProxyInner::Class(class) => Ok(key
9292
.as_interned_str(vm)
9393
.map_or(false, |key| class.attributes.read().contains_key(key))),
94-
MappingProxyInner::Mapping(mapping) => PySequence::contains(&*mapping, key, vm),
94+
MappingProxyInner::Mapping(mapping) => PySequence::contains(mapping, key, vm),
9595
}
9696
}
9797

vm/src/builtins/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ mod tests {
16111611
impl<'s> AnyStrWrapper<'s> for PyStrRef {
16121612
type Str = str;
16131613
fn as_ref(&self) -> &str {
1614-
&*self.as_str()
1614+
self.as_str()
16151615
}
16161616
}
16171617

vm/src/function/number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl TryFromObject for ArgIntoFloat {
9595
/// By default an object is considered true unless its class defines either a
9696
/// `__bool__()` method that returns False or a `__len__()` method that returns
9797
/// zero, when called with the object.
98-
#[derive(Debug, Default, PartialEq)]
98+
#[derive(Debug, Default, PartialEq, Eq)]
9999
pub struct ArgIntoBool {
100100
value: bool,
101101
}

vm/src/readline.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ mod basic_readline {
4747
return ReadlineResult::Io(e);
4848
}
4949

50-
match io::stdin().lock().lines().next() {
50+
let next_line = io::stdin().lock().lines().next();
51+
match next_line {
5152
Some(Ok(line)) => ReadlineResult::Line(line),
5253
None => ReadlineResult::Eof,
5354
Some(Err(e)) => match e.kind() {

vm/src/stdlib/itertools.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,10 @@ mod decl {
767767
}
768768
}
769769
// We don't have an int or value was < 0 or > sys.maxsize
770-
return Err(vm.new_value_error(format!(
770+
Err(vm.new_value_error(format!(
771771
"{} argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.",
772772
name
773-
)));
773+
)))
774774
}
775775

776776
#[pyimpl(with(IterNext))]

0 commit comments

Comments
 (0)