Skip to content

Commit

Permalink
Fix a bunch on lints
Browse files Browse the repository at this point in the history
  • Loading branch information
zmanian committed May 19, 2018
1 parent acd776b commit cbe5016
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::env;
use std::fs::OpenOptions;
use std::io::Write;
use std::os::unix::fs::OpenOptionsExt;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::process::exit;
use std::sync::Arc;

Expand Down
3 changes: 1 addition & 2 deletions src/types/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use amino::*;
use bytes::{Buf, BufMut};
use hex::encode;
use signatory::ed25519::{Signature, SIGNATURE_SIZE};
use std::error::Error;
use std::io::Cursor;

#[derive(PartialEq, Debug)]
Expand Down Expand Up @@ -40,7 +39,7 @@ impl Amino for Heartbeat {
check_field_number_typ3(1, Typ3Byte::Typ3_Struct, &mut buf)?;

check_field_number_typ3(1, Typ3Byte::Typ3_ByteLength, &mut buf)?;
let mut validator_address_array = amino_bytes::decode(&mut buf)?;
let validator_address_array = amino_bytes::decode(&mut buf)?;
let validator_address = validator_address_array;

check_field_number_typ3(2, Typ3Byte::Typ3_Varint, &mut buf)?;
Expand Down
2 changes: 1 addition & 1 deletion src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl PartsSetHeader {
let total = decode_varint(&mut buf)?;
// peek into the buffer without consuming it and only read if necessary:
let next_u8 = buf.bytes()[0];
let mut hash: Vec<u8> = if ((next_u8 as u64) >> 3) == 2
let hash: Vec<u8> = if ((next_u8 as u64) >> 3) == 2
&& byte_to_type3(next_u8 & 0x07) == Typ3Byte::Typ3_ByteLength
{
buf.advance(1);
Expand Down
2 changes: 1 addition & 1 deletion src/types/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Amino for Proposal {

optional_typ3 = buf.get_u8();
}
let struct_term_typ3 = buf.get_u8();
let _struct_term_typ3 = buf.get_u8();
let struct_end_postfix = typ3_to_byte(Typ3Byte::Typ3_StructTerm);
if optional_typ3 != struct_end_postfix {
return Err(DecodeError::new("invalid type for first struct term"));
Expand Down
8 changes: 4 additions & 4 deletions src/types/vote.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::{BlockID, PartsSetHeader, TendermintSign, ValidatorAddress};
use super::{BlockID, TendermintSign, ValidatorAddress};
use amino::*;
use bytes::{Buf, BufMut};
use chrono::{DateTime, Utc};
use hex::{encode, encode_upper};
use hex::encode_upper;
use signatory::ed25519::{Signature, SIGNATURE_SIZE};
use std::io::Cursor;

Expand Down Expand Up @@ -63,7 +63,7 @@ impl TendermintSign for Vote {
impl Amino for Vote {
fn serialize(self) -> Vec<u8> {
let mut buf = vec![];
let (dis, mut pre) = compute_disfix("tendermint/socketpv/SignVoteMsg");
let (_dis, mut pre) = compute_disfix("tendermint/socketpv/SignVoteMsg");

pre[3] |= typ3_to_byte(Typ3Byte::Typ3_Struct);
buf.put_slice(pre.as_slice());
Expand Down Expand Up @@ -176,7 +176,7 @@ impl Amino for Vote {

optional_typ3 = buf.get_u8();
}
let struct_term_typ3 = buf.get_u8();
let _struct_term_typ3 = buf.get_u8();
let struct_end_postfix = typ3_to_byte(Typ3Byte::Typ3_StructTerm);
if optional_typ3 != struct_end_postfix {
return Err(DecodeError::new("invalid type for first struct term"));
Expand Down

0 comments on commit cbe5016

Please sign in to comment.