Skip to content

Commit

Permalink
Clean up format
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Apr 4, 2023
1 parent ae5e1ed commit d5f1d2e
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions core/src/snapshot_packager_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,32 +401,28 @@ mod tests {
.collect();

// Create one fake snapshot.
let snapshots_paths: Vec<_> = vec![
{
let snapshot_file_name = format!("{slot}");
let snapshots_dir = snapshots_dir.join(&snapshot_file_name);
fs::create_dir_all(&snapshots_dir).unwrap();
let fake_snapshot_path = snapshots_dir.join(&snapshot_file_name);
let mut fake_snapshot_file = OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(&fake_snapshot_path)
.unwrap();
fake_snapshot_file.write_all(b"Hello, world!").unwrap();
let fake_status_cache = snapshots_dir.join(SNAPSHOT_STATUS_CACHE_FILENAME);
let mut fake_status_cache_file = OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(fake_status_cache)
.unwrap();
fake_status_cache_file
.write_all(b"Hello, status cache!")
.unwrap();
fake_snapshot_path
}];

let snapshot_file_name = format!("{slot}");
let snapshots_dir = snapshots_dir.join(&snapshot_file_name);
fs::create_dir_all(&snapshots_dir).unwrap();
let fake_snapshot_path = snapshots_dir.join(&snapshot_file_name);
let mut fake_snapshot_file = OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(&fake_snapshot_path)
.unwrap();
fake_snapshot_file.write_all(b"Hello, world!").unwrap();
let fake_status_cache = snapshots_dir.join(SNAPSHOT_STATUS_CACHE_FILENAME);
let mut fake_status_cache_file = OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(fake_status_cache)
.unwrap();
fake_status_cache_file
.write_all(b"Hello, status cache!")
.unwrap();
let snapshots_paths: Vec<_> = vec![fake_snapshot_path];

// Create directory of hard links for snapshots
let link_snapshots_dir_tmp = tempfile::tempdir_in(temp_dir).unwrap();
Expand Down

0 comments on commit d5f1d2e

Please sign in to comment.