Skip to content

Commit

Permalink
Merge pull request #2085 from agunde406/fix-lint
Browse files Browse the repository at this point in the history
Fix lint introduced with Rust 1.63
  • Loading branch information
agunde406 authored Aug 12, 2022
2 parents 4dddafb + b0daa2b commit 837d392
Show file tree
Hide file tree
Showing 84 changed files with 286 additions and 208 deletions.
18 changes: 9 additions & 9 deletions cli/src/action/circuit/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl SplinterRestClient {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct CircuitSlice {
pub id: String,
pub members: Vec<CircuitMembers>,
Expand Down Expand Up @@ -321,21 +321,21 @@ impl fmt::Display for CircuitSlice {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct CircuitServiceSlice {
pub service_id: String,
pub service_type: String,
pub node_id: String,
pub arguments: BTreeMap<String, String>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct CircuitListSlice {
pub data: Vec<CircuitSlice>,
pub paging: Paging,
}

#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct ProposalSlice {
pub proposal_type: String,
pub circuit_id: String,
Expand Down Expand Up @@ -433,7 +433,7 @@ impl fmt::Display for ProposalSlice {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct ProposalCircuitSlice {
pub circuit_id: String,
pub members: Vec<CircuitMembers>,
Expand All @@ -445,22 +445,22 @@ pub struct ProposalCircuitSlice {
pub circuit_status: Option<CircuitStatus>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct CircuitMembers {
pub node_id: String,
pub endpoints: Vec<String>,
pub public_key: Option<String>,
}

#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct CircuitService {
pub service_id: String,
pub service_type: String,
pub node_id: String,
pub arguments: Vec<Vec<String>>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct ProposalListSlice {
pub data: Vec<ProposalSlice>,
pub paging: Paging,
Expand All @@ -473,7 +473,7 @@ pub struct VoteRecord {
pub voter_node_id: String,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct Paging {
pub current: String,
pub offset: usize,
Expand Down
8 changes: 4 additions & 4 deletions cli/src/action/database/stores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ pub trait UpgradeStores {
fn new_state_tree_store<'a>(&'a self) -> Box<dyn StateTreeStore + 'a>;
}

type InTransactionHandle<'a> =
Box<dyn FnOnce(&dyn UpgradeStores) -> Result<(), InternalError> + 'a>;

pub trait TransactionalUpgradeStores: UpgradeStores {
fn in_transaction<'a>(
&self,
f: Box<dyn FnOnce(&dyn UpgradeStores) -> Result<(), InternalError> + 'a>,
) -> Result<(), InternalError>;
fn in_transaction(&self, f: InTransactionHandle<'_>) -> Result<(), InternalError>;

fn as_upgrade_stores(&self) -> &dyn UpgradeStores;
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/action/database/upgrade/node_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn migrate_node_id_to_db(
"Importing node_id from {} to database",
filename.to_string_lossy()
);
let result = import_store(&*db_store, &file_store);
let result = import_store(db_store, &file_store);

if let Ok(WarningEmitted::No) = result {
info!(
Expand Down
4 changes: 2 additions & 2 deletions libsplinter/src/admin/client/event/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Error for NextEventError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {
NextEventError::Disconnected => None,
NextEventError::InternalError(ref e) => Some(&*e),
NextEventError::InternalError(ref e) => Some(e),
}
}
}
Expand All @@ -60,7 +60,7 @@ impl Error for WaitForError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {
WaitForError::TimeoutError => None,
WaitForError::NextEventError(ref e) => Some(&*e),
WaitForError::NextEventError(ref e) => Some(e),
}
}
}
4 changes: 2 additions & 2 deletions libsplinter/src/admin/client/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use ws::actix_web_client::{
};

/// A public key for the private key that signed an admin proposal.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
#[repr(transparent)]
pub struct PublicKey(pub Vec<u8>);

Expand All @@ -55,7 +55,7 @@ pub struct AdminServiceEvent {
/// The event type.
///
/// Some variants include a public key, that is associated with the particular event.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum EventType {
ProposalSubmitted,
ProposalVote { requester: PublicKey },
Expand Down
20 changes: 10 additions & 10 deletions libsplinter/src/admin/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::error::InternalError;
#[cfg(feature = "client-reqwest")]
pub use self::reqwest::ReqwestAdminServiceClient;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Paging {
pub current: String,
pub offset: usize,
Expand All @@ -41,15 +41,15 @@ pub struct Paging {
pub last: String,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CircuitServiceSlice {
pub service_id: String,
pub service_type: String,
pub node_id: String,
pub arguments: BTreeMap<String, String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CircuitSlice {
pub id: String,
pub members: Vec<CircuitMembers>,
Expand All @@ -58,28 +58,28 @@ pub struct CircuitSlice {
pub display_name: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CircuitListSlice {
pub data: Vec<CircuitSlice>,
pub paging: Paging,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CircuitMembers {
pub node_id: String,
pub endpoints: Vec<String>,
pub public_key: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CircuitService {
pub service_id: String,
pub service_type: String,
pub node_id: String,
pub arguments: Vec<Vec<String>>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProposalCircuitSlice {
pub circuit_id: String,
pub members: Vec<CircuitMembers>,
Expand All @@ -89,14 +89,14 @@ pub struct ProposalCircuitSlice {
pub display_name: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct VoteRecord {
pub public_key: String,
pub vote: String,
pub voter_node_id: String,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProposalSlice {
pub proposal_type: String,
pub circuit_id: String,
Expand All @@ -107,7 +107,7 @@ pub struct ProposalSlice {
pub requester_node_id: String,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProposalListSlice {
pub data: Vec<ProposalSlice>,
pub paging: Paging,
Expand Down
2 changes: 1 addition & 1 deletion libsplinter/src/admin/service/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub enum PayloadType {
Consensus(ProposalId, (Proposal, CircuitManagementPayload)),
}

#[derive(PartialEq, Clone, Copy)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum AdminServiceStatus {
NotRunning,
Running,
Expand Down
Loading

0 comments on commit 837d392

Please sign in to comment.