Skip to content

Commit de4de82

Browse files
authored
Merge pull request #2665 from input-output-hk/jpraynaud/fix-rust-1.89
fix: Rust `1.89` clippy warnings
2 parents 72050f3 + e5d2384 commit de4de82

File tree

34 files changed

+190
-199
lines changed

34 files changed

+190
-199
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mithril-dmq/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mithril-dmq"
33
description = "Mechanisms to publish and consume messages of a 'Decentralized Message Queue network' through a DMQ node"
4-
version = "0.1.6"
4+
version = "0.1.7"
55
authors.workspace = true
66
documentation.workspace = true
77
edition.workspace = true

internal/mithril-dmq/src/consumer/pallas.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<M: TryFromBytes + Debug> DmqConsumerPallas<M> {
5151
}
5252

5353
/// Gets the cached `DmqClient`, creating a new one if it does not exist.
54-
async fn get_client(&self) -> StdResult<MutexGuard<Option<DmqClient>>> {
54+
async fn get_client(&self) -> StdResult<MutexGuard<'_, Option<DmqClient>>> {
5555
{
5656
// Run this in a separate block to avoid dead lock on the Mutex
5757
let client_lock = self.client.lock().await;

internal/mithril-persistence/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-persistence"
3-
version = "0.2.57"
3+
version = "0.2.58"
44
description = "Common types, interfaces, and utilities to persist data for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-persistence/src/database/version_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mod tests {
317317
.read::<i64, _>(0)
318318
}
319319

320-
fn create_db_checker(connection: &ConnectionThreadSafe) -> DatabaseVersionChecker {
320+
fn create_db_checker(connection: &ConnectionThreadSafe) -> DatabaseVersionChecker<'_> {
321321
DatabaseVersionChecker::new(
322322
discard_logger(),
323323
ApplicationNodeType::Aggregator,

internal/mithril-persistence/src/sqlite/connection_extensions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::sqlite::{EntityCursor, Query, SqliteConnection, Transaction};
88
/// Extension trait for the [SqliteConnection] type.
99
pub trait ConnectionExtensions {
1010
/// Begin a transaction on the connection.
11-
fn begin_transaction(&self) -> StdResult<Transaction>;
11+
fn begin_transaction(&self) -> StdResult<Transaction<'_>>;
1212

1313
/// Execute the given sql query and return the value of the first cell read.
1414
fn query_single_cell<Q: AsRef<str>, T: ReadableWithIndex>(
@@ -18,7 +18,7 @@ pub trait ConnectionExtensions {
1818
) -> StdResult<T>;
1919

2020
/// Fetch entities from the database using the given query.
21-
fn fetch<Q: Query>(&self, query: Q) -> StdResult<EntityCursor<Q::Entity>>;
21+
fn fetch<Q: Query>(&self, query: Q) -> StdResult<EntityCursor<'_, Q::Entity>>;
2222

2323
/// Fetch the first entity from the database returned using the given query.
2424
fn fetch_first<Q: Query>(&self, query: Q) -> StdResult<Option<Q::Entity>> {
@@ -39,7 +39,7 @@ pub trait ConnectionExtensions {
3939
}
4040

4141
impl ConnectionExtensions for SqliteConnection {
42-
fn begin_transaction(&self) -> StdResult<Transaction> {
42+
fn begin_transaction(&self) -> StdResult<Transaction<'_>> {
4343
Ok(Transaction::begin(self)?)
4444
}
4545

@@ -54,7 +54,7 @@ impl ConnectionExtensions for SqliteConnection {
5454
statement.read::<T, _>(0).with_context(|| "Read query error")
5555
}
5656

57-
fn fetch<Q: Query>(&self, query: Q) -> StdResult<EntityCursor<Q::Entity>> {
57+
fn fetch<Q: Query>(&self, query: Q) -> StdResult<EntityCursor<'_, Q::Entity>> {
5858
let (condition, params) = query.filters().expand();
5959
let sql = query.get_definition(&condition);
6060
let cursor = prepare_statement(self, &sql)?.into_iter().bind(&params[..])?;

internal/mithril-persistence/src/sqlite/connection_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl SqliteConnectionPool {
4747
}
4848

4949
/// Get a connection from the pool
50-
pub fn connection(&self) -> StdResult<ResourcePoolItem<SqlitePooledConnection>> {
50+
pub fn connection(&self) -> StdResult<ResourcePoolItem<'_, SqlitePooledConnection>> {
5151
let timeout = Duration::from_millis(1000);
5252
let connection = self.connection_pool.acquire_resource(timeout)?;
5353

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.7.78"
3+
version = "0.7.79"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/dependency_injection/builder/support/sqlite.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ impl DependenciesBuilder {
5353
let _ = connection.execute("pragma analysis_limit=400; pragma optimize;");
5454
}
5555

56-
if let Some(pool) = &self.sqlite_connection_cardano_transaction_pool {
57-
if let Ok(connection) = pool.connection() {
58-
let _ = connection.execute("pragma analysis_limit=400; pragma optimize;");
59-
}
56+
if let Some(pool) = &self.sqlite_connection_cardano_transaction_pool
57+
&& let Ok(connection) = pool.connection()
58+
{
59+
let _ = connection.execute("pragma analysis_limit=400; pragma optimize;");
6060
}
6161
}
6262

mithril-aggregator/src/file_uploaders/cloud_uploader/api.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@ impl CloudUploader {
4646
impl FileUploader for CloudUploader {
4747
async fn upload_without_retry(&self, file_path: &Path) -> StdResult<FileUri> {
4848
let remote_file_path = self.remote_folder.join(get_file_name(file_path)?);
49-
if !self.allow_overwrite {
50-
if let Some(file_uri) = self
49+
if !self.allow_overwrite
50+
&& let Some(file_uri) = self
5151
.cloud_backend_uploader
5252
.file_exists(&remote_file_path)
5353
.await
5454
.with_context(|| "checking if file exists in cloud")?
55-
{
56-
return Ok(file_uri);
57-
}
55+
{
56+
return Ok(file_uri);
5857
}
5958

6059
let file_uri = self

0 commit comments

Comments
 (0)