From 7227f722ac8570fb1630dfb8618005eb01ccde74 Mon Sep 17 00:00:00 2001 From: Stiopa Koltsov Date: Sat, 6 Aug 2022 08:42:43 -0700 Subject: [PATCH] Apply rustfmt Reviewed By: zertosh Differential Revision: D38485159 fbshipit-source-id: 0abdf44561da00697953fe2cb9211ceb5cf27ac0 --- packer/src/error.rs | 5 +++-- packer/src/main.rs | 11 ++++++----- packer/src/tarsum.rs | 9 ++++++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packer/src/error.rs b/packer/src/error.rs index 54a5a684f..b0e2ead94 100644 --- a/packer/src/error.rs +++ b/packer/src/error.rs @@ -5,11 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -use crate::types::PackType; -use crate::types::Platform; use std::fmt; use std::path::PathBuf; +use crate::types::PackType; +use crate::types::Platform; + #[derive(Debug)] pub enum Error { MissingPackFile(Platform, PackType, PathBuf), diff --git a/packer/src/main.rs b/packer/src/main.rs index 88a7acc8e..8a5e79a33 100644 --- a/packer/src/main.rs +++ b/packer/src/main.rs @@ -13,11 +13,6 @@ mod error; mod tarsum; mod types; -use anyhow::bail; -use anyhow::Context; -use anyhow::Result; -use rayon::prelude::IntoParallelIterator; -use rayon::prelude::ParallelIterator; use std::collections::BTreeMap; use std::ffi; use std::fs::File; @@ -26,6 +21,12 @@ use std::io::BufReader; use std::io::BufWriter; use std::io::Write; use std::path; + +use anyhow::bail; +use anyhow::Context; +use anyhow::Result; +use rayon::prelude::IntoParallelIterator; +use rayon::prelude::ParallelIterator; use types::HashSum; use types::PackMode; use types::PackType; diff --git a/packer/src/tarsum.rs b/packer/src/tarsum.rs index d7eb44900..77ad658aa 100644 --- a/packer/src/tarsum.rs +++ b/packer/src/tarsum.rs @@ -7,11 +7,13 @@ //! Intrinsic hash for a tarball. -use crate::types; -use anyhow::Result; use std::collections; use std::io; +use anyhow::Result; + +use crate::types; + /// Computes the intrinsic SHA256 checksum of a tar archive. pub fn tarsum(reader: R) -> Result { use sha2::Digest; @@ -46,10 +48,11 @@ fn digest_file(reader: &mut R) -> io::Result { #[cfg(test)] mod test { - use super::*; use std::fs; use std::path; + use super::*; + #[test] fn test_nested_archive_tarsum() { // This is an archive with a nested directory structure.