Skip to content

Commit 2fa5a4b

Browse files
cargo fmt under Rust edition 2024
Edition 2024 reorders imports by full path (case-sensitive within a module) instead of the 2021 mixed rules, and tightens a couple of trailing-semicolon cases. Pure mechanical reformat — no behavior change. Restores green on CI's `cargo fmt --all -- --check` step.
1 parent 0f7b49c commit 2fa5a4b

7 files changed

Lines changed: 16 additions & 16 deletions

File tree

src-tauri/src/commands/backup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
use std::io::Read;
1818
use std::path::{Component, Path, PathBuf};
1919

20+
use flate2::Compression;
2021
use flate2::read::GzDecoder;
2122
use flate2::write::GzEncoder;
22-
use flate2::Compression;
2323
use serde::{Deserialize, Serialize};
2424
use tar::{Archive, Builder, Header};
2525
use tauri::State;
2626

2727
use crate::error::{CommandError, CommandResult};
2828
use crate::state::{
29-
sanitize_username, AppState, IdentityConfig, IdentityIndexEntry, IDENTITY_CONFIG_FILE,
29+
AppState, IDENTITY_CONFIG_FILE, IdentityConfig, IdentityIndexEntry, sanitize_username,
3030
};
3131

3232
/// Stable on-disk file names that survive an export → import round-trip.
@@ -507,7 +507,7 @@ fn ensure_safe_relative(rel: &str) -> Result<(), CommandError> {
507507
return Err(CommandError::new(
508508
"validation",
509509
format!("archive path `{rel}` contains an unsafe component"),
510-
))
510+
));
511511
}
512512
}
513513
}

src-tauri/src/commands/identity.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Identity commands: init/unlock, show, publish, refresh prekeys, plus
22
//! the multi-identity list/switch surface.
33
4-
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
54
use base64::Engine as _;
5+
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
66
use rand::RngCore as _;
77
use serde::{Deserialize, Serialize};
88
use tauri::State;
@@ -11,8 +11,8 @@ use dnsmesh_client::{DmpClient, DmpClientConfig};
1111

1212
use crate::error::{CommandError, CommandResult};
1313
use crate::state::{
14-
build_reader, build_writer, sanitize_username, ActiveClient, AppState, IdentityConfig,
15-
IdentityIndexEntry, PublishConfig,
14+
ActiveClient, AppState, IdentityConfig, IdentityIndexEntry, PublishConfig, build_reader,
15+
build_writer, sanitize_username,
1616
};
1717

1818
/// Length of the per-identity Argon2id salt we mint on first creation.
@@ -404,8 +404,8 @@ fn materialise_publish_block(
404404
(_, Some(b64)) => {
405405
// Validate the base64 before touching the filesystem so a
406406
// bad payload doesn't leave a half-written secret behind.
407-
use base64::engine::general_purpose::STANDARD as BASE64;
408407
use base64::Engine as _;
408+
use base64::engine::general_purpose::STANDARD as BASE64;
409409
BASE64.decode(b64).map_err(|e| {
410410
CommandError::new(
411411
"validation",

src-tauri/src/commands/import_cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
2727
use std::path::PathBuf;
2828

29-
use base64::engine::general_purpose::STANDARD as BASE64;
3029
use base64::Engine as _;
30+
use base64::engine::general_purpose::STANDARD as BASE64;
3131
use serde::{Deserialize, Serialize};
3232
use tauri::State;
3333

3434
use crate::error::{CommandError, CommandResult};
3535
use crate::state::{
36-
sanitize_username, AppState, IdentityConfig, IdentityIndexEntry, PublishConfig,
36+
AppState, IdentityConfig, IdentityIndexEntry, PublishConfig, sanitize_username,
3737
};
3838

3939
/// On-disk shape of the CLI's `config.yaml`. Only the slice the

src-tauri/src/commands/messaging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ use std::time::{SystemTime, UNIX_EPOCH};
77
use serde::{Deserialize, Serialize};
88
use tauri::State;
99

10-
use dnsmesh_client::addressing::{slot_domain, SLOT_COUNT};
1110
use dnsmesh_client::InboxMessage;
11+
use dnsmesh_client::addressing::{SLOT_COUNT, slot_domain};
1212
use dnsmesh_core::manifest::SlotManifest;
1313

1414
use crate::error::{CommandError, CommandResult};
15-
use crate::state::{build_reader, AppState};
15+
use crate::state::{AppState, build_reader};
1616

1717
/// Args for [`send_message`].
1818
#[derive(Debug, Clone, Deserialize)]

src-tauri/src/commands/nodes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ pub async fn register_tsig(
655655
.map_err(CommandError::from)?;
656656
match cfg.kdf_salt_base64 {
657657
Some(b64) => {
658-
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
659658
use base64::Engine as _;
659+
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
660660
Some(BASE64_STANDARD.decode(&b64).map_err(|e| {
661661
CommandError::new(
662662
"internal",
@@ -720,8 +720,8 @@ pub async fn register_tsig(
720720
)
721721
})?;
722722
let secret_base64 = {
723-
use base64::engine::general_purpose::STANDARD as BASE64;
724723
use base64::Engine as _;
724+
use base64::engine::general_purpose::STANDARD as BASE64;
725725
BASE64.encode(&secret_bytes)
726726
};
727727

src-tauri/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! via `From` impls so commands can `?` SDK errors freely.
88
99
use serde::Serialize;
10-
use serde_json::{json, Value as JsonValue};
10+
use serde_json::{Value as JsonValue, json};
1111

1212
/// Error envelope returned by every Tauri command.
1313
#[derive(Debug, Clone, Serialize)]

src-tauri/src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use std::path::{Component, Path, PathBuf};
99
use std::sync::Arc;
1010

11-
use anyhow::{anyhow, Context, Result};
11+
use anyhow::{Context, Result, anyhow};
1212
use dnsmesh_client::DmpClient;
1313
use dnsmesh_net::{
1414
DnsRecordReader, DnsRecordWriter, DnsUpdateWriter, DnsUpdateWriterConfig, InMemoryDnsStore,
@@ -303,8 +303,8 @@ pub fn build_writer(publish: Option<&PublishConfig>) -> Result<(Arc<dyn DnsRecor
303303
/// Read a TSIG secret from disk. Accepts `base64:` / `hex:` prefixes
304304
/// or raw bytes — same shape the CLI consumes.
305305
fn read_tsig_secret(path: &Path) -> Result<Vec<u8>> {
306-
use base64::engine::general_purpose::STANDARD as BASE64;
307306
use base64::Engine as _;
307+
use base64::engine::general_purpose::STANDARD as BASE64;
308308

309309
let bytes = std::fs::read(path)
310310
.with_context(|| format!("reading TSIG secret at {}", path.display()))?;

0 commit comments

Comments
 (0)