Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 3431586

Browse files
authored
Merge pull request #1466 from agunde406/fix-lint
Fix lint introduced in Rust 1.63
2 parents ad21609 + 131fe96 commit 3431586

File tree

100 files changed

+453
-455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+453
-455
lines changed

cli/src/actions/product.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,10 @@ fn determine_file_type(path: &str) -> Result<ProductFileType, CliError> {
232232
path
233233
))),
234234
Some(os_str) => match os_str.to_str() {
235-
None => {
236-
return Err(CliError::UserError(format!(
237-
"Unable to determine file extension: {}",
238-
path
239-
)))
240-
}
235+
None => Err(CliError::UserError(format!(
236+
"Unable to determine file extension: {}",
237+
path
238+
))),
241239
Some("yaml") | Some("yml") => Ok(ProductFileType::SchemaBasedDefinition),
242240
Some("xml") => Ok(ProductFileType::Gdsn3_1),
243241
Some(_) => Err(CliError::UserError(format!(

cli/src/actions/xsd_downloader/downloader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn download(url: &Url, file_name: &str) -> Result<(), CliError> {
5454
}
5555

5656
/// Configuration for the caching downloader
57-
#[derive(Debug, PartialEq)]
57+
#[derive(Debug, PartialEq, Eq)]
5858
pub struct CachingDownloadConfig {
5959
pub url: Url,
6060
pub file_path: PathBuf,

cli/src/actions/xsd_downloader/extractor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn copy_schemas(file: impl Read + Seek, dest_path: &Path) -> Result<(), CliError
103103

104104
debug!("extracting {outpath}", outpath = outpath.to_string_lossy());
105105

106-
if (&*file.name()).ends_with('/') {
106+
if (file.name()).ends_with('/') {
107107
debug!("File {} extracted to \"{}\"", i, outpath.display());
108108
fs::create_dir_all(&outpath)
109109
.map_err(|err| CliError::InternalError(err.to_string()))?;

cli/src/actions/xsd_downloader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const DOWNLOADS: &[UrlFile] = &[UrlFile {
5656
}];
5757

5858
/// Defines how file downloads will be handled in a cached context
59-
#[derive(Clone, Debug, PartialEq)]
59+
#[derive(Clone, Debug, PartialEq, Eq)]
6060
pub enum DownloadConfig {
6161
#[cfg(feature = "xsd-downloader-force-download")]
6262
Always,

contracts/purchase_order/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ cfg_if! {
3535
}
3636

3737
pub mod handler;
38-
pub(in crate) mod payload;
38+
pub(crate) mod payload;
3939
pub mod permissions;
4040
mod state;
41-
pub(in crate) mod workflow;
41+
pub(crate) mod workflow;
4242

4343
#[cfg(not(target_arch = "wasm32"))]
4444
fn main() {

daemon/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl Error for DaemonError {
5555
}
5656
}
5757

58-
#[derive(Debug, PartialEq)]
58+
#[derive(Debug, PartialEq, Eq)]
5959
pub enum ConfigurationError {
6060
MissingValue(String),
6161
}

daemon/src/splinter/app_auth_handler/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::fmt;
2020
use std::thread;
2121
use std::time::Duration;
2222

23-
#[derive(Debug, PartialEq)]
23+
#[derive(Debug, PartialEq, Eq)]
2424
pub struct GetNodeError(pub String);
2525

2626
impl Error for GetNodeError {

griddle/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub use default::DefaultPartialGriddleConfigBuilder;
3939
pub use env::EnvPartialGriddleConfigBuilder;
4040
pub use partial::{GriddleConfigSource, PartialGriddleConfig};
4141

42-
#[derive(Clone, Debug, PartialEq)]
42+
#[derive(Clone, Debug, PartialEq, Eq)]
4343
/// Placeholder for indicating the scope of the requests, will be used to determine if requests
4444
/// to Griddle should include a scope ID and what format ID to expect
4545
pub enum Scope {

griddle/src/config/partial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use crate::config::Scope;
1919

2020
/// Displays the source of the configuration value
21-
#[derive(Debug, Clone, PartialEq)]
21+
#[derive(Debug, Clone, PartialEq, Eq)]
2222
pub enum GriddleConfigSource {
2323
Default,
2424
Environment,

griddle/src/rest_api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod error;
1818

1919
pub use error::GriddleRestApiServerError;
2020

21-
#[derive(Clone, Debug, PartialEq)]
21+
#[derive(Clone, Debug, PartialEq, Eq)]
2222
/// Indicates the service scope intended for incoming requests and is used by the REST API to
2323
/// validate requests.
2424
pub enum Scope {

sdk/src/batch_submission/submission/submitter/batch_submitter/async_batch_submitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const RETRY_ATTEMPTS: u16 = 10;
3939
// Time the submitter will wait to repoll after receiving None, in milliseconds
4040
const POLLING_INTERVAL: u64 = 1000;
4141

42-
#[derive(Debug, PartialEq)]
42+
#[derive(Debug, PartialEq, Eq)]
4343
// Carries the submission response from the http client back through the submitter to the observer
4444
// Struct is publicly visible via traits associated with BatchSubmitterBuilder but not accessible
4545
// outside the batch_submitter module

sdk/src/batch_submission/submission/url_resolver/basic_url_resolver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::scope_id::{GlobalScopeId, ServiceScopeId};
1717
use super::UrlResolver;
1818

1919
/// A url resolver for the `GlobalScopeId`
20-
#[derive(Debug, Clone, PartialEq)]
20+
#[derive(Debug, Clone, PartialEq, Eq)]
2121
pub struct GlobalUrlResolver {
2222
base_url: String,
2323
}
@@ -38,7 +38,7 @@ impl UrlResolver for GlobalUrlResolver {
3838
}
3939

4040
/// A url resolver for the `ServiceScopeId`
41-
#[derive(Debug, Clone, PartialEq)]
41+
#[derive(Debug, Clone, PartialEq, Eq)]
4242
pub struct ServiceUrlResolver {
4343
base_url: String,
4444
}

sdk/src/batch_tracking/store/diesel/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
pub mod models;
1616
mod operations;
17-
pub(in crate) mod schema;
17+
pub(crate) mod schema;
1818

1919
use diesel::connection::AnsiTransactionManager;
2020
use diesel::r2d2::{ConnectionManager, Pool};

sdk/src/batch_tracking/store/diesel/models.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::batch_tracking::store::error::BatchTrackingStoreError;
2727

2828
pub const DCID_FORMAT: &str = "^dcid:[\\w\\-\\+=/~!@#\\$%\\^&\\*{}|\\[\\]<>\\?]+$";
2929

30-
#[derive(Identifiable, Insertable, Queryable, PartialEq, Debug, Clone)]
30+
#[derive(Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, Clone)]
3131
#[table_name = "batches"]
3232
#[primary_key(service_id, batch_id)]
3333
pub struct NewBatchModel {
@@ -40,7 +40,7 @@ pub struct NewBatchModel {
4040
pub submitted: bool,
4141
}
4242

43-
#[derive(Identifiable, Insertable, Queryable, PartialEq, Debug, Clone)]
43+
#[derive(Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, Clone)]
4444
#[table_name = "batches"]
4545
#[primary_key(service_id, batch_id)]
4646
pub struct BatchModel {
@@ -54,7 +54,7 @@ pub struct BatchModel {
5454
pub created_at: i64,
5555
}
5656

57-
#[derive(Identifiable, Insertable, Queryable, PartialEq, Debug, QueryableByName)]
57+
#[derive(Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, QueryableByName)]
5858
#[table_name = "transactions"]
5959
#[primary_key(service_id, transaction_id)]
6060
pub struct TransactionModel {
@@ -68,7 +68,7 @@ pub struct TransactionModel {
6868
}
6969

7070
#[derive(
71-
Identifiable, Insertable, Queryable, PartialEq, Debug, AsChangeset, Clone, QueryableByName,
71+
Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, AsChangeset, Clone, QueryableByName,
7272
)]
7373
#[table_name = "transaction_receipts"]
7474
#[primary_key(service_id, transaction_id)]
@@ -92,7 +92,7 @@ pub struct NewBatchStatusModel {
9292
pub dlt_status: String,
9393
}
9494

95-
#[derive(Identifiable, Insertable, Queryable, PartialEq, Debug, Clone)]
95+
#[derive(Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, Clone)]
9696
#[table_name = "batch_statuses"]
9797
#[primary_key(service_id, batch_id)]
9898
pub struct BatchStatusModel {
@@ -103,7 +103,7 @@ pub struct BatchStatusModel {
103103
pub updated_at: i64,
104104
}
105105

106-
#[derive(Insertable, PartialEq, Queryable, Debug, AsChangeset)]
106+
#[derive(Insertable, PartialEq, Eq, Queryable, Debug, AsChangeset)]
107107
#[changeset_options(treat_none_as_null = "true")]
108108
#[table_name = "submissions"]
109109
pub struct NewSubmissionModel {
@@ -113,7 +113,7 @@ pub struct NewSubmissionModel {
113113
pub error_message: Option<String>,
114114
}
115115

116-
#[derive(Identifiable, Insertable, Queryable, PartialEq, Debug, QueryableByName)]
116+
#[derive(Identifiable, Insertable, Queryable, PartialEq, Eq, Debug, QueryableByName)]
117117
#[table_name = "submissions"]
118118
#[primary_key(service_id, batch_id)]
119119
pub struct SubmissionModel {

sdk/src/batch_tracking/store/diesel/operations/add_batches.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ impl<'a> BatchTrackingStoreAddBatchesOperation
3737
self.conn.transaction::<_, BatchTrackingStoreError, _>(|| {
3838
insert_into(batches::table)
3939
.values(batch_models)
40-
.execute(&*self.conn)
40+
.execute(self.conn)
4141
.map(|_| ())
4242
.map_err(BatchTrackingStoreError::from)?;
4343

4444
insert_into(transactions::table)
4545
.values(transaction_models)
46-
.execute(&*self.conn)
46+
.execute(self.conn)
4747
.map(|_| ())
4848
.map_err(BatchTrackingStoreError::from)?;
4949

@@ -62,13 +62,13 @@ impl<'a> BatchTrackingStoreAddBatchesOperation
6262
self.conn.transaction::<_, BatchTrackingStoreError, _>(|| {
6363
insert_into(batches::table)
6464
.values(batch_models)
65-
.execute(&*self.conn)
65+
.execute(self.conn)
6666
.map(|_| ())
6767
.map_err(BatchTrackingStoreError::from)?;
6868

6969
insert_into(transactions::table)
7070
.values(transaction_models)
71-
.execute(&*self.conn)
71+
.execute(self.conn)
7272
.map(|_| ())
7373
.map_err(BatchTrackingStoreError::from)?;
7474

sdk/src/batch_tracking/store/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ use crate::error::{InternalError, InvalidArgumentError};
2626
use crate::scope_id::{GlobalScopeId, ServiceScopeId};
2727

2828
#[cfg(feature = "diesel")]
29-
pub(in crate) mod diesel;
29+
pub(crate) mod diesel;
3030
mod error;
3131

3232
pub use error::{BatchBuilderError, BatchTrackingStoreError};
3333

3434
const NON_SPLINTER_SERVICE_ID_DEFAULT: &str = "----";
3535

36-
#[derive(Clone, Debug, PartialEq)]
36+
#[derive(Clone, Debug, PartialEq, Eq)]
3737
pub enum BatchStatus {
3838
Unknown,
3939
Pending,
@@ -94,7 +94,7 @@ impl fmt::Display for BatchStatusName {
9494
}
9595
}
9696

97-
#[derive(Clone, Debug, PartialEq)]
97+
#[derive(Clone, Debug, PartialEq, Eq)]
9898
pub struct InvalidTransaction {
9999
transaction_id: String,
100100
// These are for errors from the DLT itself
@@ -212,7 +212,7 @@ impl InvalidTransactionBuilder {
212212
}
213213
}
214214

215-
#[derive(Clone, Debug, PartialEq)]
215+
#[derive(Clone, Debug, PartialEq, Eq)]
216216
pub struct ValidTransaction {
217217
transaction_id: String,
218218
}
@@ -246,7 +246,7 @@ impl ValidTransactionBuilder {
246246
}
247247
}
248248

249-
#[derive(Clone, Debug, PartialEq)]
249+
#[derive(Clone, Debug, PartialEq, Eq)]
250250
pub struct SubmissionError {
251251
error_type: String,
252252
error_message: String,
@@ -304,7 +304,7 @@ impl SubmissionErrorBuilder {
304304
}
305305
}
306306

307-
#[derive(Debug, PartialEq, Clone)]
307+
#[derive(Debug, PartialEq, Eq, Clone)]
308308
pub struct TrackingBatch {
309309
service_id: Option<String>,
310310
batch_header: String,
@@ -522,12 +522,12 @@ impl TrackingBatchBuilder {
522522
}
523523
}
524524

525-
#[derive(Debug, PartialEq, Clone)]
525+
#[derive(Debug, PartialEq, Eq, Clone)]
526526
pub struct TrackingBatchList {
527527
pub batches: Vec<TrackingBatch>,
528528
}
529529

530-
#[derive(Debug, PartialEq, Clone)]
530+
#[derive(Debug, PartialEq, Eq, Clone)]
531531
pub struct TrackingTransaction {
532532
family_name: String,
533533
family_version: String,
@@ -777,7 +777,7 @@ impl TransactionReceiptBuilder {
777777
}
778778
}
779779

780-
#[derive(Debug, PartialEq, Clone)]
780+
#[derive(Debug, PartialEq, Eq, Clone)]
781781
pub struct ServiceTrackingBatch {
782782
scope_id: ServiceScopeId,
783783
batch_header: String,
@@ -864,7 +864,7 @@ impl std::convert::TryFrom<TrackingBatch> for ServiceTrackingBatch {
864864
}
865865
}
866866

867-
#[derive(Debug, PartialEq, Clone)]
867+
#[derive(Debug, PartialEq, Eq, Clone)]
868868
pub struct GlobalTrackingBatch {
869869
scope_id: GlobalScopeId,
870870
batch_header: String,

sdk/src/batches/store/diesel/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
pub mod models;
1616
mod operations;
17-
pub(in crate) mod schema;
17+
pub(crate) mod schema;
1818

1919
use diesel::connection::AnsiTransactionManager;
2020
use diesel::r2d2::{ConnectionManager, Pool};

sdk/src/batches/store/diesel/models.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use crate::batches::store::{diesel::schema::*, Batch, BatchSubmitInfo, Transaction};
1616
use chrono::NaiveDateTime;
1717

18-
#[derive(Insertable, Queryable, PartialEq, Debug)]
18+
#[derive(Insertable, Queryable, PartialEq, Eq, Debug)]
1919
#[table_name = "batches"]
2020
pub struct BatchModel {
2121
pub header_signature: String,
@@ -32,7 +32,7 @@ pub struct BatchModel {
3232
pub service_id: Option<String>,
3333
}
3434

35-
#[derive(Insertable, Queryable, PartialEq, Debug)]
35+
#[derive(Insertable, Queryable, PartialEq, Eq, Debug)]
3636
#[table_name = "transactions"]
3737
pub struct TransactionModel {
3838
pub header_signature: String,
@@ -42,7 +42,7 @@ pub struct TransactionModel {
4242
pub signer_public_key: String,
4343
}
4444

45-
#[derive(Insertable, PartialEq, Debug)]
45+
#[derive(Insertable, PartialEq, Eq, Debug)]
4646
#[table_name = "transaction_receipts"]
4747
pub struct TransactionReceiptModel {
4848
pub transaction_id: String,

sdk/src/batches/store/diesel/operations/add_batch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ impl<'a> AddBatchOperation for BatchStoreOperations<'a, diesel::pg::PgConnection
3535
self.conn.transaction::<_, BatchStoreError, _>(|| {
3636
insert_into(batches::table)
3737
.values(batch_model)
38-
.execute(&*self.conn)
38+
.execute(self.conn)
3939
.map(|_| ())
4040
.map_err(|err| {
4141
BatchStoreError::InternalError(InternalError::from_source(Box::new(err)))
4242
})?;
4343

4444
insert_into(transactions::table)
4545
.values(transaction_models)
46-
.execute(&*self.conn)
46+
.execute(self.conn)
4747
.map(|_| ())
4848
.map_err(|err| {
4949
BatchStoreError::InternalError(InternalError::from_source(Box::new(err)))
@@ -61,15 +61,15 @@ impl<'a> AddBatchOperation for BatchStoreOperations<'a, diesel::sqlite::SqliteCo
6161
self.conn.transaction::<_, BatchStoreError, _>(|| {
6262
insert_into(batches::table)
6363
.values(batch_model)
64-
.execute(&*self.conn)
64+
.execute(self.conn)
6565
.map(|_| ())
6666
.map_err(|err| {
6767
BatchStoreError::InternalError(InternalError::from_source(Box::new(err)))
6868
})?;
6969

7070
insert_into(transactions::table)
7171
.values(transaction_models)
72-
.execute(&*self.conn)
72+
.execute(self.conn)
7373
.map(|_| ())
7474
.map_err(|err| {
7575
BatchStoreError::InternalError(InternalError::from_source(Box::new(err)))

0 commit comments

Comments
 (0)