From 4f2c76150faea81d5d2a8fc4cf8dd77f003c4f91 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 11 Feb 2020 08:39:35 -0700 Subject: [PATCH] Clippy --- sdk/src/clock.rs | 2 +- sdk/src/entrypoint.rs | 4 ++-- sdk/src/hash.rs | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/src/clock.rs b/sdk/src/clock.rs index 275fb37333..22b36606c6 100644 --- a/sdk/src/clock.rs +++ b/sdk/src/clock.rs @@ -57,7 +57,7 @@ pub const MAX_TRANSACTION_FORWARDING_DELAY: usize = 6; /// Converts a slot to a storage segment. Does not indicate that a segment is complete. pub fn get_segment_from_slot(rooted_slot: Slot, slots_per_segment: u64) -> Segment { - ((rooted_slot + (slots_per_segment - 1)) / slots_per_segment) + (rooted_slot + (slots_per_segment - 1)) / slots_per_segment } /// Given a slot returns the latest complete segment, if no segment could possibly be complete diff --git a/sdk/src/entrypoint.rs b/sdk/src/entrypoint.rs index 32c713699c..2ae5bf2d94 100644 --- a/sdk/src/entrypoint.rs +++ b/sdk/src/entrypoint.rs @@ -70,14 +70,14 @@ pub unsafe fn deserialize<'a>(input: *mut u8) -> (&'a Pubkey, Vec(); let is_writable = { #[allow(clippy::cast_ptr_alignment)] let is_writable = *(input.add(offset) as *const u8); - (is_writable != 0) + is_writable != 0 }; offset += size_of::(); diff --git a/sdk/src/hash.rs b/sdk/src/hash.rs index 9dcd5db471..87c19a0507 100644 --- a/sdk/src/hash.rs +++ b/sdk/src/hash.rs @@ -1,6 +1,5 @@ //! The `hash` module provides functions for creating SHA-256 hashes. -use bs58; use sha2::{Digest, Sha256}; use std::{convert::TryFrom, fmt, mem, str::FromStr}; @@ -97,7 +96,6 @@ pub fn extend_and_hash(id: &Hash, val: &[u8]) -> Hash { #[cfg(test)] mod tests { use super::*; - use bs58; #[test] fn test_hash_fromstr() {