Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix nightly clippy warnings
  • Loading branch information
youknowone committed Jun 23, 2022
commit 8c0be4b48fe4477e20e6027c197ad339ac7aa3cc
2 changes: 1 addition & 1 deletion ast/src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl std::fmt::Display for Constant {
}

/// Transforms a value prior to formatting it.
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ConversionFlag {
/// Converts by calling `str(<value>)`.
Expand Down
2 changes: 1 addition & 1 deletion ast/src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::fmt;

/// A location somewhere in the sourcecode.
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct Location {
row: usize,
column: usize,
Expand Down
12 changes: 6 additions & 6 deletions bytecode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
use std::{collections::BTreeSet, fmt, hash};

/// Sourcecode location.
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct Location {
row: u32,
column: u32,
Expand Down Expand Up @@ -158,7 +158,7 @@ impl fmt::Display for Label {
}

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

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

/// A Single bytecode instruction.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum Instruction {
/// Importing by name
ImportName {
Expand Down Expand Up @@ -582,7 +582,7 @@ pub enum TestOperator {
/// use rustpython_bytecode::BinaryOperator::Add;
/// let op = BinaryOperation {op: Add};
/// ```
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum BinaryOperator {
Power,
Multiply,
Expand All @@ -600,7 +600,7 @@ pub enum BinaryOperator {
}

/// The possible unary operators
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum UnaryOperator {
Not,
Invert,
Expand Down
2 changes: 1 addition & 1 deletion common/src/encodings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ where
}
// we need to coerce the lifetime to that of the function body rather than the
// anonymous input lifetime, so that we can assign it data borrowed from data_from_err
let mut data = &*data;
let mut data = data;
let mut data_from_err: E::BytesBuf;
let mut out = String::with_capacity(data.len());
let mut remaining_index = 0;
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/symboltable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl SymbolTable {
}
}

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

/// Indicator for a single symbol what the scope of this symbol is.
/// The scope can be unknown, which is unfortunate, but not impossible.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SymbolScope {
Unknown,
Local,
Expand Down
2 changes: 1 addition & 1 deletion jit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl JitSig {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum JitType {
Int,
Expand Down
2 changes: 1 addition & 1 deletion vm/src/builtins/mappingproxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl PyMappingProxy {
MappingProxyInner::Class(class) => Ok(key
.as_interned_str(vm)
.map_or(false, |key| class.attributes.read().contains_key(key))),
MappingProxyInner::Mapping(mapping) => PySequence::contains(&*mapping, key, vm),
MappingProxyInner::Mapping(mapping) => PySequence::contains(mapping, key, vm),
}
}

Expand Down
2 changes: 1 addition & 1 deletion vm/src/builtins/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ mod tests {
impl<'s> AnyStrWrapper<'s> for PyStrRef {
type Str = str;
fn as_ref(&self) -> &str {
&*self.as_str()
self.as_str()
}
}

Expand Down
2 changes: 1 addition & 1 deletion vm/src/function/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl TryFromObject for ArgIntoFloat {
/// By default an object is considered true unless its class defines either a
/// `__bool__()` method that returns False or a `__len__()` method that returns
/// zero, when called with the object.
#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, PartialEq, Eq)]
pub struct ArgIntoBool {
value: bool,
}
Expand Down
3 changes: 2 additions & 1 deletion vm/src/readline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ mod basic_readline {
return ReadlineResult::Io(e);
}

match io::stdin().lock().lines().next() {
let next_line = io::stdin().lock().lines().next();
match next_line {
Some(Ok(line)) => ReadlineResult::Line(line),
None => ReadlineResult::Eof,
Some(Err(e)) => match e.kind() {
Expand Down
4 changes: 2 additions & 2 deletions vm/src/stdlib/itertools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,10 @@ mod decl {
}
}
// We don't have an int or value was < 0 or > sys.maxsize
return Err(vm.new_value_error(format!(
Err(vm.new_value_error(format!(
"{} argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.",
name
)));
)))
}

#[pyimpl(with(IterNext))]
Expand Down