Fix nightly clippy

This commit is contained in:
Jeong YunWon 2020-10-01 07:08:26 +09:00
parent 6c96793f05
commit 09b8414162
2 changed files with 6 additions and 21 deletions

View file

@ -61,10 +61,7 @@ enum FunctionContext {
impl CompileContext { impl CompileContext {
fn in_func(self) -> bool { fn in_func(self) -> bool {
match self.func { !matches!(self.func, FunctionContext::NoFunction)
FunctionContext::NoFunction => false,
_ => true,
}
} }
} }
@ -2006,13 +2003,9 @@ impl<O: OutputStream> Compiler<O> {
// a list of expressions on the stack, or a list of tuples. // a list of expressions on the stack, or a list of tuples.
fn gather_elements(&mut self, elements: &[ast::Expression]) -> CompileResult<bool> { fn gather_elements(&mut self, elements: &[ast::Expression]) -> CompileResult<bool> {
// First determine if we have starred elements: // First determine if we have starred elements:
let has_stars = elements.iter().any(|e| { let has_stars = elements
if let ast::ExpressionType::Starred { .. } = &e.node { .iter()
true .any(|e| matches!(e.node, ast::ExpressionType::Starred { .. }));
} else {
false
}
});
for element in elements { for element in elements {
if let ast::ExpressionType::Starred { value } = &element.node { if let ast::ExpressionType::Starred { value } = &element.node {

View file

@ -136,19 +136,11 @@ impl Symbol {
} }
pub fn is_global(&self) -> bool { pub fn is_global(&self) -> bool {
if let SymbolScope::Global = self.scope { matches!(self.scope, SymbolScope::Global)
true
} else {
false
}
} }
pub fn is_local(&self) -> bool { pub fn is_local(&self) -> bool {
if let SymbolScope::Local = self.scope { matches!(self.scope, SymbolScope::Local)
true
} else {
false
}
} }
} }