fix(clippy): apply auto-fixable linting suggestions

This commit is contained in:
Clippy Bot
2026-06-23 18:47:23 +00:00
parent 4fd75701c7
commit cc21036448
425 changed files with 79190 additions and 79190 deletions

View File

@@ -1 +1 @@
/target
/target

10436
useragent/rust/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,17 @@
[package]
name = "rust_lib_arbiter"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "staticlib"]
[dependencies]
eframe = "0.34.1"
egui = "0.34.1"
flutter_rust_bridge = "=2.12.0"
arbiter-crypto = {path = "../../server/crates/arbiter-crypto"}
anyhow = "1.0.102"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }
[package]
name = "rust_lib_arbiter"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "staticlib"]
[dependencies]
eframe = "0.34.1"
egui = "0.34.1"
flutter_rust_bridge = "=2.12.0"
arbiter-crypto = {path = "../../server/crates/arbiter-crypto"}
anyhow = "1.0.102"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }

View File

@@ -1,38 +1,38 @@
use anyhow::anyhow;
use arbiter_crypto::authn::{self, AuthChallenge, USERAGENT_CONTEXT};
use flutter_rust_bridge::frb;
#[frb(opaque)]
pub struct MldsaKey(authn::SigningKey);
impl MldsaKey {
pub fn from_bytes(bytes: &[u8]) -> anyhow::Result<Self> {
let bytes: [u8; 32] = bytes
.try_into()
.map_err(|_| anyhow!("Invalid key length"))?;
Ok(Self(authn::SigningKey::from_seed(bytes)))
}
pub fn to_bytes(&self) -> Vec<u8> {
self.0.to_seed().to_vec()
}
pub fn sign(&self, message: &[u8]) -> anyhow::Result<Vec<u8>> {
Ok(self.0.sign_message(message, USERAGENT_CONTEXT)?.to_bytes())
}
pub fn generate() -> Self {
Self(authn::SigningKey::generate())
}
pub fn get_public_key(&self) -> Vec<u8> {
self.0.public_key().to_bytes().to_vec()
}
}
pub fn format_challenge(random: Vec<u8>, timestamp: i64) -> Result<Vec<u8>, String> {
let challenge = AuthChallenge::from_parts(&random, timestamp)
.map_err(|_| "Invalid nonce length".to_string())?;
Ok(challenge.format())
}
use anyhow::anyhow;
use arbiter_crypto::authn::{self, AuthChallenge, USERAGENT_CONTEXT};
use flutter_rust_bridge::frb;
#[frb(opaque)]
pub struct MldsaKey(authn::SigningKey);
impl MldsaKey {
pub fn from_bytes(bytes: &[u8]) -> anyhow::Result<Self> {
let bytes: [u8; 32] = bytes
.try_into()
.map_err(|_| anyhow!("Invalid key length"))?;
Ok(Self(authn::SigningKey::from_seed(bytes)))
}
pub fn to_bytes(&self) -> Vec<u8> {
self.0.to_seed().to_vec()
}
pub fn sign(&self, message: &[u8]) -> anyhow::Result<Vec<u8>> {
Ok(self.0.sign_message(message, USERAGENT_CONTEXT)?.to_bytes())
}
pub fn generate() -> Self {
Self(authn::SigningKey::generate())
}
pub fn get_public_key(&self) -> Vec<u8> {
self.0.public_key().to_bytes().to_vec()
}
}
pub fn format_challenge(random: Vec<u8>, timestamp: i64) -> Result<Vec<u8>, String> {
let challenge = AuthChallenge::from_parts(&random, timestamp)
.map_err(|_| "Invalid nonce length".to_string())?;
Ok(challenge.format())
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
pub mod api;
mod frb_generated;
pub mod api;
mod frb_generated;