From 3cc5dd6485dcb998be5d3fa1a5f378836f1ef153 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Mon, 15 Apr 2019 17:34:09 +0200 Subject: [PATCH] Format it. --- src/module.rs | 2 +- src/prepare/compile.rs | 2 +- src/prepare/mod.rs | 5 ++++- src/runner.rs | 2 +- validation/src/context.rs | 2 +- validation/src/func.rs | 9 ++------- validation/src/lib.rs | 1 - validation/src/util.rs | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/module.rs b/src/module.rs index 10ed6b7..51666d8 100644 --- a/src/module.rs +++ b/src/module.rs @@ -10,7 +10,6 @@ use hashbrown::HashMap; #[cfg(feature = "std")] use std::collections::HashMap; -use validation::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX}; use core::cell::Ref; use func::{FuncBody, FuncInstance, FuncRef}; use global::{GlobalInstance, GlobalRef}; @@ -21,6 +20,7 @@ use memory_units::Pages; use parity_wasm::elements::{External, InitExpr, Instruction, Internal, ResizableLimits, Type}; use table::TableRef; use types::{GlobalDescriptor, MemoryDescriptor, TableDescriptor}; +use validation::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX}; use {Error, MemoryInstance, Module, RuntimeValue, Signature, TableInstance}; /// Reference to a [`ModuleInstance`]. diff --git a/src/prepare/compile.rs b/src/prepare/compile.rs index 7bf412a..759f1e0 100644 --- a/src/prepare/compile.rs +++ b/src/prepare/compile.rs @@ -4,9 +4,9 @@ use validation::context::ModuleContext; use validation::func::{ require_label, top_label, BlockFrame, FunctionValidationContext, StackValueType, StartedWith, }; +use validation::stack::StackWithLimit; use validation::util::Locals; use validation::{Error, FunctionValidator}; -use validation::stack::StackWithLimit; use isa; diff --git a/src/prepare/mod.rs b/src/prepare/mod.rs index 4fc9ca2..790c126 100644 --- a/src/prepare/mod.rs +++ b/src/prepare/mod.rs @@ -1,4 +1,7 @@ -use crate::{isa, validation::{Error, validate_module2, Validation}}; +use crate::{ + isa, + validation::{validate_module2, Error, Validation}, +}; use parity_wasm::elements::Module; mod compile; diff --git a/src/runner.rs b/src/runner.rs index 1240619..edd23ac 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -1,6 +1,5 @@ #[allow(unused_imports)] use alloc::prelude::*; -use validation::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX}; use core::fmt; use core::ops; use core::{u32, usize}; @@ -12,6 +11,7 @@ use memory_units::Pages; use module::ModuleRef; use nan_preserving_float::{F32, F64}; use parity_wasm::elements::Local; +use validation::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX}; use value::{ ArithmeticOps, ExtendInto, Float, Integer, LittleEndianConvert, RuntimeValue, TransmuteInto, TryTruncateInto, WrapInto, diff --git a/validation/src/context.rs b/validation/src/context.rs index 11f4ebf..f95fe70 100644 --- a/validation/src/context.rs +++ b/validation/src/context.rs @@ -1,9 +1,9 @@ +use crate::Error; #[allow(unused_imports)] use alloc::prelude::*; use parity_wasm::elements::{ BlockType, FunctionType, GlobalType, MemoryType, TableType, ValueType, }; -use crate::Error; #[derive(Default, Debug)] pub struct ModuleContext { diff --git a/validation/src/func.rs b/validation/src/func.rs index 23d5fb0..b7fc28d 100644 --- a/validation/src/func.rs +++ b/validation/src/func.rs @@ -2,13 +2,8 @@ use alloc::prelude::*; use crate::{ - DEFAULT_MEMORY_INDEX, - DEFAULT_TABLE_INDEX, - Error, - FunctionValidator, - stack::StackWithLimit, - util::Locals, - context::ModuleContext, + context::ModuleContext, stack::StackWithLimit, util::Locals, Error, FunctionValidator, + DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX, }; use core::u32; diff --git a/validation/src/lib.rs b/validation/src/lib.rs index cdce855..aeb5b26 100644 --- a/validation/src/lib.rs +++ b/validation/src/lib.rs @@ -1,7 +1,6 @@ // TODO: Uncomment // #![warn(missing_docs)] - #![cfg_attr(not(feature = "std"), no_std)] //// alloc is required in no_std #![cfg_attr(not(feature = "std"), feature(alloc))] diff --git a/validation/src/util.rs b/validation/src/util.rs index 43b3d8b..44639ef 100644 --- a/validation/src/util.rs +++ b/validation/src/util.rs @@ -1,7 +1,7 @@ +use crate::Error; #[allow(unused_imports)] use alloc::prelude::*; use parity_wasm::elements::{Local, ValueType}; -use crate::Error; /// Locals are the concatenation of a slice of function parameters /// with function declared local variables.