From 4f25d435165d05078848c17492f767c5f1ef4688 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Thu, 10 Oct 2019 19:43:33 +0200 Subject: [PATCH] [keccak-hasher]: rust2018 (#11163) --- util/keccak-hasher/Cargo.toml | 1 + util/keccak-hasher/src/lib.rs | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index 09b0de352..b10267f3a 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "keccak-hasher" version = "0.1.1" +edition = "2018" authors = ["Parity Technologies "] description = "Keccak-256 implementation of the Hasher trait" license = "GPL-3.0" diff --git a/util/keccak-hasher/src/lib.rs b/util/keccak-hasher/src/lib.rs index d9c9be545..b40d274d3 100644 --- a/util/keccak-hasher/src/lib.rs +++ b/util/keccak-hasher/src/lib.rs @@ -15,15 +15,14 @@ // along with Parity Ethereum. If not, see . //! Hasher implementation for the Keccak-256 hash -extern crate hash_db; -extern crate ethereum_types; -extern crate tiny_keccak; -extern crate plain_hasher; + +#![warn(missing_docs)] use hash_db::Hasher; use ethereum_types::H256; use tiny_keccak::Keccak; use plain_hasher::PlainHasher; + /// Concrete `Hasher` impl for the Keccak-256 hash #[derive(Default, Debug, Clone, PartialEq)] pub struct KeccakHasher; @@ -32,7 +31,7 @@ impl Hasher for KeccakHasher { type StdHasher = PlainHasher; const LENGTH: usize = 32; fn hash(x: &[u8]) -> Self::Out { - let mut out = [0;32]; + let mut out = [0; 32]; Keccak::keccak256(x, &mut out); out.into() }