ci: update to Rust 1.76 and fix clippy warnings

This commit is contained in:
link2xt
2024-02-25 09:56:12 +00:00
parent 9862d40f89
commit 44686d6caa
3 changed files with 13 additions and 14 deletions

View File

@@ -24,7 +24,7 @@ jobs:
name: Lint Rust name: Lint Rust
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
RUSTUP_TOOLCHAIN: 1.75.0 RUSTUP_TOOLCHAIN: 1.76.0
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -83,11 +83,11 @@ jobs:
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
rust: 1.75.0 rust: 1.76.0
- os: windows-latest - os: windows-latest
rust: 1.75.0 rust: 1.76.0
- os: macos-latest - os: macos-latest
rust: 1.75.0 rust: 1.76.0
# Minimum Supported Rust Version = 1.70.0 # Minimum Supported Rust Version = 1.70.0
- os: ubuntu-latest - os: ubuntu-latest

View File

@@ -79,7 +79,7 @@ pub(crate) trait DcKey: Serialize + Deserializable + KeyTrait + Clone {
} }
pub(crate) async fn load_self_public_key(context: &Context) -> Result<SignedPublicKey> { pub(crate) async fn load_self_public_key(context: &Context) -> Result<SignedPublicKey> {
match context let public_key = context
.sql .sql
.query_row_optional( .query_row_optional(
"SELECT public_key "SELECT public_key
@@ -91,8 +91,8 @@ pub(crate) async fn load_self_public_key(context: &Context) -> Result<SignedPubl
Ok(bytes) Ok(bytes)
}, },
) )
.await? .await?;
{ match public_key {
Some(bytes) => SignedPublicKey::from_slice(&bytes), Some(bytes) => SignedPublicKey::from_slice(&bytes),
None => { None => {
let keypair = generate_keypair(context).await?; let keypair = generate_keypair(context).await?;
@@ -102,7 +102,7 @@ pub(crate) async fn load_self_public_key(context: &Context) -> Result<SignedPubl
} }
pub(crate) async fn load_self_secret_key(context: &Context) -> Result<SignedSecretKey> { pub(crate) async fn load_self_secret_key(context: &Context) -> Result<SignedSecretKey> {
match context let private_key = context
.sql .sql
.query_row_optional( .query_row_optional(
"SELECT private_key "SELECT private_key
@@ -114,8 +114,8 @@ pub(crate) async fn load_self_secret_key(context: &Context) -> Result<SignedSecr
Ok(bytes) Ok(bytes)
}, },
) )
.await? .await?;
{ match private_key {
Some(bytes) => SignedSecretKey::from_slice(&bytes), Some(bytes) => SignedSecretKey::from_slice(&bytes),
None => { None => {
let keypair = generate_keypair(context).await?; let keypair = generate_keypair(context).await?;

View File

@@ -804,7 +804,7 @@ async fn send_mdn(context: &Context, smtp: &mut Smtp) -> Result<bool> {
.sql .sql
.execute("DELETE FROM smtp_mdns WHERE retries > 6", []) .execute("DELETE FROM smtp_mdns WHERE retries > 6", [])
.await?; .await?;
let msg_row = match context let Some(msg_row) = context
.sql .sql
.query_row_optional( .query_row_optional(
"SELECT msg_id, from_id FROM smtp_mdns ORDER BY retries LIMIT 1", "SELECT msg_id, from_id FROM smtp_mdns ORDER BY retries LIMIT 1",
@@ -816,9 +816,8 @@ async fn send_mdn(context: &Context, smtp: &mut Smtp) -> Result<bool> {
}, },
) )
.await? .await?
{ else {
Some(msg_row) => msg_row, return Ok(false);
None => return Ok(false),
}; };
let (msg_id, contact_id) = msg_row; let (msg_id, contact_id) = msg_row;