clean up imports and useless allow attributes

This commit is contained in:
Jeong Yunwon 2022-04-15 23:15:01 +09:00
parent a4f34f64e9
commit bedb508667
3 changed files with 6 additions and 7 deletions

View file

@ -88,7 +88,6 @@ struct CompileContext {
}
#[derive(Debug, Clone, Copy, PartialEq)]
#[allow(clippy::enum_variant_names)]
enum FunctionContext {
NoFunction,
Function,

View file

@ -1,7 +1,6 @@
use rustpython_ast::Location;
use std::error::Error;
use std::fmt;
use std::{error::Error, fmt};
#[derive(Debug)]
pub struct CompileError {

View file

@ -7,11 +7,12 @@ load and store instructions for names.
Inspirational file: https://github.com/python/cpython/blob/main/Python/symtable.c
*/
use crate::error::{CompileError, CompileErrorType};
use crate::IndexMap;
use crate::{
error::{CompileError, CompileErrorType},
IndexMap,
};
use rustpython_ast::{self as ast, Location};
use std::borrow::Cow;
use std::fmt;
use std::{borrow::Cow, fmt};
pub fn make_symbol_table(program: &[ast::Stmt]) -> SymbolTableResult<SymbolTable> {
let mut builder = SymbolTableBuilder::new();