darwinia-network / darwinia

Darwinia Chain, EVM+, Polkadot parachain and integrating with XCMP.
https://darwinia.network
GNU General Public License v3.0
244 stars 49 forks source link

Eliminate All Warnings in Core Lib #136

Closed AurevoirXavier closed 4 years ago

AurevoirXavier commented 4 years ago
warning: unused import: `crate::std::*`
 --> core/merkle-patricia-trie/src/nibbles.rs:1:5
  |
1 | use crate::std::*;
  |     ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::std::*`
 --> core/merkle-patricia-trie/src/proof.rs:1:5
  |
1 | use crate::std::*;
  |     ^^^^^^^^^^^^^

warning: unused `std::result::Result` that must be used
  --> core/merkle-patricia-trie/src/lib.rs:72:3
   |
72 |         trie.insert(key.as_ref().to_vec(), value.as_ref().to_vec());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused import: `ethbloom::Bloom`
 --> core/sr-eth-primitives/src/pow.rs:8:5
  |
8 | use ethbloom::Bloom;
  |     ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `H160`, `U128`
  --> core/sr-eth-primitives/src/pow.rs:12:23
   |
12 | use primitive_types::{H160, H256, U128, U256, U512};
   |                       ^^^^        ^^^^

warning: unused variable: `progpow`
   --> core/sr-eth-primitives/src/pow.rs:282:82
    |
282 | fn quick_get_difficulty(header_hash: &[u8; 32], nonce: u64, mix_hash: &[u8; 32], progpow: bool) -> [u8; 32] {
    |                                                                                  ^^^^^^^ help: consider prefixing with an underscore: `_progpow`
    |
    = note: `#[warn(unused_variables)]` on by default
AurevoirXavier commented 4 years ago
warning: unused `std::result::Result` that must be used
  --> core/merkle-patricia-trie/src/lib.rs:49:3
   |
49 |         trie.insert(key.as_ref().to_vec(), value.as_ref().to_vec());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled
AurevoirXavier commented 4 years ago
warning: unused import: `ethbloom::Bloom`
   --> core/sr-eth-primitives/src/receipt.rs:122:6
    |
122 |     use ethbloom::Bloom;
    |         ^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

warning: unused import: `triehash::ordered_trie_root`
   --> core/sr-eth-primitives/src/receipt.rs:128:6
    |
128 |     use triehash::ordered_trie_root;
    |         ^^^