Skip to content

Commit f5ca54d

Browse files
authored
cargo fmt
I think it changed for Rust 2024?
1 parent a77efcf commit f5ca54d

33 files changed

+92
-82
lines changed

src/archive.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,12 @@ mod test {
409409
use std::fs;
410410
use std::io::Read;
411411

412-
use assert_fs::prelude::*;
413412
use assert_fs::TempDir;
413+
use assert_fs::prelude::*;
414414

415415
use crate::monitor::test::TestMonitor;
416-
use crate::test_fixtures::store_two_versions;
417416
use crate::test_fixtures::TreeFixture;
417+
use crate::test_fixtures::store_two_versions;
418418

419419
#[tokio::test]
420420
async fn create_then_open_archive() {
@@ -452,12 +452,13 @@ mod test {
452452
let af = Archive::create_temp().await;
453453

454454
assert!(af.transport().local_path().unwrap().is_dir());
455-
assert!(af
456-
.transport()
457-
.local_path()
458-
.unwrap()
459-
.join("CONSERVE")
460-
.is_file());
455+
assert!(
456+
af.transport()
457+
.local_path()
458+
.unwrap()
459+
.join("CONSERVE")
460+
.is_file()
461+
);
461462
assert!(af.transport().local_path().unwrap().join("d").is_dir());
462463

463464
let header_path = af.transport().local_path().unwrap().join("CONSERVE");

src/backup.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use std::fmt;
1818
use std::io::prelude::*;
1919
use std::mem::take;
2020
use std::path::Path;
21-
use std::sync::atomic::Ordering::Relaxed;
2221
use std::sync::Arc;
22+
use std::sync::atomic::Ordering::Relaxed;
2323
use std::time::{Duration, Instant};
2424

2525
use bytes::BytesMut;
@@ -657,16 +657,16 @@ mod test {
657657
use std::sync::Arc;
658658
use std::sync::Mutex;
659659

660-
use assert_fs::{prelude::*, TempDir};
660+
use assert_fs::{TempDir, prelude::*};
661661

662-
use filetime::{set_file_mtime, FileTime};
662+
use filetime::{FileTime, set_file_mtime};
663663
use tracing_test::traced_test;
664664

665665
use crate::counters::Counter;
666666
use crate::monitor::test::TestMonitor;
667667
use crate::test_fixtures::TreeFixture;
668-
use crate::transport::record::Verb;
669668
use crate::transport::Transport;
669+
use crate::transport::record::Verb;
670670
use crate::*;
671671

672672
use super::*;
@@ -717,8 +717,7 @@ mod test {
717717
assert_eq!(change.to_string(), "- /a");
718718
}
719719

720-
const HELLO_HASH: &str =
721-
"9063990e5c5b2184877f92adace7c801a549b00c39cd7549877f06d5dd0d3a6ca6eee42d5\
720+
const HELLO_HASH: &str = "9063990e5c5b2184877f92adace7c801a549b00c39cd7549877f06d5dd0d3a6ca6eee42d5\
722721
896bdac64831c8114c55cee664078bd105dc691270c92644ccb2ce7";
723722

724723
#[tokio::test]
@@ -1464,9 +1463,11 @@ mod test {
14641463
["GC_LOCK", "b0000/BANDTAIL"],
14651464
"don't get metadata for data blocks"
14661465
);
1467-
assert!(metadata_calls
1468-
.iter()
1469-
.all(|c| c.ends_with("BANDTAIL") || c.ends_with("GC_LOCK")));
1466+
assert!(
1467+
metadata_calls
1468+
.iter()
1469+
.all(|c| c.ends_with("BANDTAIL") || c.ends_with("GC_LOCK"))
1470+
);
14701471

14711472
// Change one of the files, and in a new backup it should be recognized
14721473
// as unmodified.
@@ -1493,7 +1494,8 @@ mod test {
14931494
let metadata_calls = recording.verb_paths(Verb::Metadata);
14941495
println!("metadata calls for third backup after modification: {metadata_calls:#?}");
14951496
assert_eq!(
1496-
metadata_calls, ["GC_LOCK", "b0001/BANDTAIL"],
1497+
metadata_calls,
1498+
["GC_LOCK", "b0001/BANDTAIL"],
14971499
"with modification to one file, backup is expected to get metadata for lock and previous band tail: {metadata_calls:#?}"
14981500
);
14991501
}

src/bin/conserve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ use std::path::{Path, PathBuf};
2020
use std::sync::{Arc, RwLock};
2121
use std::time::Instant;
2222

23-
use clap::builder::{styling, Styles};
23+
use clap::builder::{Styles, styling};
2424
use clap::{Parser, Subcommand};
2525
use conserve::change::Change;
2626
use time::UtcOffset;
2727
#[allow(unused_imports)]
28-
use tracing::{debug, error, info, trace, warn, Level};
28+
use tracing::{Level, debug, error, info, trace, warn};
2929

3030
use crate::transport::Transport;
31-
use conserve::termui::{enable_tracing, TermUiMonitor, TraceTimeStyle};
31+
use conserve::termui::{TermUiMonitor, TraceTimeStyle, enable_tracing};
3232
use conserve::*;
3333

3434
/// Local timezone offset, calculated once at startup, to avoid issues about

src/blockhash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::fmt::{Debug, Display};
1818
use std::hash::{Hash, Hasher};
1919
use std::str::FromStr;
2020

21-
use blake2_rfc::blake2b::{blake2b, Blake2bResult};
21+
use blake2_rfc::blake2b::{Blake2bResult, blake2b};
2222
use serde::{Deserialize, Serialize};
2323

2424
use crate::*;

src/counters.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ mod test {
151151
assert_eq!(counters.get(c), v);
152152
});
153153
assert_eq!(counters.iter().count(), Counter::COUNT);
154-
assert!(counters
155-
.iter()
156-
.all(|(c, v)| (c == Counter::Files) == (v == 2)));
154+
assert!(
155+
counters
156+
.iter()
157+
.all(|(c, v)| (c == Counter::Files) == (v == 2))
158+
);
157159
}
158160

159161
#[test]

src/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl Diff {
8989

9090
#[cfg(test)]
9191
mod tests {
92-
use filetime::{set_file_mtime, FileTime};
92+
use filetime::{FileTime, set_file_mtime};
9393

9494
use crate::monitor::test::TestMonitor;
9595
use crate::test_fixtures::TreeFixture;

src/index/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::monitor::Monitor;
2323
use crate::transport::{Transport, WriteMode};
2424
use crate::*;
2525

26-
use super::{hunk_relpath, subdir_relpath, HUNKS_PER_SUBDIR};
26+
use super::{HUNKS_PER_SUBDIR, hunk_relpath, subdir_relpath};
2727

2828
/// Write out index hunks.
2929
///

src/jsonio.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ mod tests {
156156
#[tokio::test]
157157
async fn read_json_is_none_for_nonexistent_files() {
158158
let transport = Transport::temp();
159-
assert!(read_json::<TestContents>(&transport, "nonexistent.json")
160-
.await
161-
.expect("No error for nonexistent file")
162-
.is_none());
159+
assert!(
160+
read_json::<TestContents>(&transport, "nonexistent.json")
161+
.await
162+
.expect("No error for nonexistent file")
163+
.is_none()
164+
);
163165
}
164166
}

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,24 @@ pub mod validate;
5353
pub use crate::apath::Apath;
5454
pub use crate::archive::Archive;
5555
pub use crate::archive::DeleteOptions;
56-
pub use crate::backup::{backup, BackupOptions, BackupStats};
56+
pub use crate::backup::{BackupOptions, BackupStats, backup};
5757
pub use crate::band::{Band, BandSelectionPolicy};
5858
pub use crate::bandid::BandId;
5959
pub use crate::blockhash::BlockHash;
6060
pub use crate::change::{ChangeCallback, EntryChange};
61-
pub use crate::diff::{diff, DiffOptions};
61+
pub use crate::diff::{DiffOptions, diff};
6262
pub use crate::entry::EntryTrait;
6363
pub use crate::errors::Error;
6464
pub use crate::excludes::Exclude;
6565
pub use crate::gc_lock::GarbageCollectionLock;
66-
pub use crate::index::{entry::IndexEntry, IndexRead, IndexWriter};
66+
pub use crate::index::{IndexRead, IndexWriter, entry::IndexEntry};
6767
pub use crate::kind::Kind;
6868
pub use crate::merge::MergeTrees;
6969
pub use crate::misc::bytes_to_human_mb;
70-
pub use crate::mount::{mount, MountOptions};
70+
pub use crate::mount::{MountOptions, mount};
7171
pub use crate::owner::Owner;
72-
pub use crate::restore::{restore, RestoreOptions};
73-
pub use crate::show::{show_versions, ShowVersionsOptions};
72+
pub use crate::restore::{RestoreOptions, restore};
73+
pub use crate::show::{ShowVersionsOptions, show_versions};
7474
pub use crate::source::SourceTree;
7575
pub use crate::stats::DeleteStats;
7676
pub use crate::stored_tree::StoredTree;

src/monitor/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use std::mem::take;
66
use std::sync::{Arc, Mutex};
77

8-
use super::task::{Task, TaskList};
98
use super::Monitor;
9+
use super::task::{Task, TaskList};
1010
use crate::counters::{Counter, Counters};
1111
use crate::{Apath, Error};
1212

0 commit comments

Comments
 (0)