From 873c03396ee0b858ccf147a0e7f7b5e5a97d4771 Mon Sep 17 00:00:00 2001 From: Stiopa Koltsov Date: Fri, 1 Jul 2022 09:21:52 -0700 Subject: [PATCH] Apply rustfmt Reviewed By: zertosh, passy Differential Revision: D37579214 fbshipit-source-id: 0e52bd2b27abbbde32f77b073d3ed5ef33f4d318 --- packer/src/error.rs | 3 ++- packer/src/main.rs | 20 +++++++++++++++----- packer/src/types.rs | 3 ++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packer/src/error.rs b/packer/src/error.rs index 0e27b9500..54a5a684f 100644 --- a/packer/src/error.rs +++ b/packer/src/error.rs @@ -5,7 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -use crate::types::{PackType, Platform}; +use crate::types::PackType; +use crate::types::Platform; use std::fmt; use std::path::PathBuf; diff --git a/packer/src/main.rs b/packer/src/main.rs index e8ec504ee..4fe75b43a 100644 --- a/packer/src/main.rs +++ b/packer/src/main.rs @@ -13,14 +13,23 @@ mod error; mod tarsum; mod types; -use anyhow::{bail, Context, Result}; -use rayon::prelude::{IntoParallelIterator, ParallelIterator}; +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; -use std::io::{self, BufReader, BufWriter, Write}; +use std::io::BufReader; +use std::io::BufWriter; +use std::io::Write; +use std::io::{self}; use std::path; -use types::{HashSum, PackMode, PackType, Platform}; +use types::HashSum; +use types::PackMode; +use types::PackType; +use types::Platform; const DEFAULT_PACKLIST: &str = include_str!("packlist.yaml"); // This is to ensure that all progress bar prefixes are aligned. @@ -221,7 +230,8 @@ fn pack_platform_exact( /// Calculate the sha256 checksum of a file represented by a Reader. fn sha256_digest(mut reader: &mut R) -> Result { - use sha2::{Digest, Sha256}; + use sha2::Digest; + use sha2::Sha256; let mut sha256 = Sha256::new(); std::io::copy(&mut reader, &mut sha256)?; diff --git a/packer/src/types.rs b/packer/src/types.rs index 76a667dbe..4c17f2993 100644 --- a/packer/src/types.rs +++ b/packer/src/types.rs @@ -5,7 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -use std::fmt::{self, Display}; +use std::fmt::Display; +use std::fmt::{self}; use std::str; #[derive(Eq, PartialEq, Debug, PartialOrd, Ord, Clone, serde::Deserialize)]