From 5dd378271f209fcbe69b8c01cf92732b87afc67b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 17 Dec 2018 13:00:29 +0000 Subject: [PATCH] Be more strict on importing crates --- libchisel/src/deployer.rs | 4 ++-- libchisel/src/lib.rs | 4 ++-- libchisel/src/remapimports.rs | 3 +-- libchisel/src/trimexports.rs | 4 +--- libchisel/src/verifyexports.rs | 1 - libchisel/src/verifyimports.rs | 1 - 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/libchisel/src/deployer.rs b/libchisel/src/deployer.rs index c5d3677..b9e995e 100644 --- a/libchisel/src/deployer.rs +++ b/libchisel/src/deployer.rs @@ -1,6 +1,6 @@ +use super::ModuleCreator; use parity_wasm::builder; - -use super::*; +use parity_wasm::elements::{CustomSection, Module}; use byteorder::{LittleEndian, WriteBytesExt}; use rustc_hex::FromHex; diff --git a/libchisel/src/lib.rs b/libchisel/src/lib.rs index b7a0615..2df83e3 100644 --- a/libchisel/src/lib.rs +++ b/libchisel/src/lib.rs @@ -2,6 +2,8 @@ extern crate byteorder; extern crate parity_wasm; extern crate rustc_hex; +use parity_wasm::elements::Module; + pub mod checkstartfunc; pub mod deployer; pub mod remapimports; @@ -9,8 +11,6 @@ pub mod trimexports; pub mod verifyexports; pub mod verifyimports; -use parity_wasm::elements::*; - pub trait ModuleCreator { fn create(&self) -> Result; } diff --git a/libchisel/src/remapimports.rs b/libchisel/src/remapimports.rs index 739144f..4629a69 100644 --- a/libchisel/src/remapimports.rs +++ b/libchisel/src/remapimports.rs @@ -1,9 +1,8 @@ use std::collections::HashMap; +use super::ModuleTranslator; use parity_wasm::elements::*; -use super::*; - #[derive(Hash, Eq, PartialEq, Debug, Clone)] pub struct ImportPair { pub module: String, diff --git a/libchisel/src/trimexports.rs b/libchisel/src/trimexports.rs index db051bd..50a9a1f 100644 --- a/libchisel/src/trimexports.rs +++ b/libchisel/src/trimexports.rs @@ -1,6 +1,4 @@ -use super::*; - -use parity_wasm::builder::*; +use super::ModuleTranslator; use parity_wasm::elements::*; /// Struct containing a list of valid exports. diff --git a/libchisel/src/verifyexports.rs b/libchisel/src/verifyexports.rs index 480c71b..c17713a 100644 --- a/libchisel/src/verifyexports.rs +++ b/libchisel/src/verifyexports.rs @@ -1,5 +1,4 @@ use super::ModuleValidator; - use parity_wasm::elements::{ ExportSection, External, FunctionSection, FunctionType, ImportSection, Internal, Module, Type, }; diff --git a/libchisel/src/verifyimports.rs b/libchisel/src/verifyimports.rs index 7ebaffb..653cdee 100644 --- a/libchisel/src/verifyimports.rs +++ b/libchisel/src/verifyimports.rs @@ -1,5 +1,4 @@ use super::ModuleValidator; - use parity_wasm::elements::{External, FunctionType, ImportSection, Module, Type, ValueType}; /// Enum representing a type of import and any extra data to check.