diff --git a/parser/src/ast.rs b/parser/src/ast.rs index cf7676a3b..1b985db2d 100644 --- a/parser/src/ast.rs +++ b/parser/src/ast.rs @@ -4,7 +4,7 @@ pub use super::lexer::Location; use num_bigint::BigInt; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /* #[derive(Debug)] diff --git a/parser/src/lexer.rs b/parser/src/lexer.rs index 269864daf..1fe74e3e1 100644 --- a/parser/src/lexer.rs +++ b/parser/src/lexer.rs @@ -7,12 +7,12 @@ extern crate unicode_xid; pub use super::token::Tok; use num_bigint::BigInt; use num_traits::Num; +use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::collections::HashMap; use std::str::FromStr; use unic_emoji_char::is_emoji_presentation; use unicode_xid::UnicodeXID; -use serde::{Serialize, Deserialize}; #[derive(Clone, Copy, PartialEq, Debug)] struct IndentationLevel { diff --git a/vm/src/bytecode.rs b/vm/src/bytecode.rs index 5291cd0c3..fb8cab98b 100644 --- a/vm/src/bytecode.rs +++ b/vm/src/bytecode.rs @@ -8,9 +8,9 @@ use num_bigint::BigInt; use num_complex::Complex64; use rustpython_parser::ast; +use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::fmt; -use serde::{Serialize, Deserialize}; /// Primary container of a single code object. Each python function has /// a codeobject. Also a module has a codeobject. diff --git a/vm/src/stdlib/marshal.rs b/vm/src/stdlib/marshal.rs index 047559881..e7afc86d2 100644 --- a/vm/src/stdlib/marshal.rs +++ b/vm/src/stdlib/marshal.rs @@ -1,8 +1,8 @@ -use crate::obj::objcode::{PyCodeRef, PyCode}; -use crate::pyobject::{PyObjectRef, PyResult, IntoPyObject}; -use crate::vm::VirtualMachine; -use crate::obj::objbytes::{PyBytes, PyBytesRef}; use crate::bytecode; +use crate::obj::objbytes::{PyBytes, PyBytesRef}; +use crate::obj::objcode::{PyCode, PyCodeRef}; +use crate::pyobject::{IntoPyObject, PyObjectRef, PyResult}; +use crate::vm::VirtualMachine; fn marshal_dumps(co: PyCodeRef, vm: &VirtualMachine) -> PyResult { PyBytes::new(bincode::serialize(&co.code).unwrap()).into_pyobject(vm) @@ -21,4 +21,4 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef { "loads" => ctx.new_rustfunc(marshal_loads), "dumps" => ctx.new_rustfunc(marshal_dumps) }) -} \ No newline at end of file +}