Apply rustfmt
Reviewed By: zertosh Differential Revision: D38485159 fbshipit-source-id: 0abdf44561da00697953fe2cb9211ceb5cf27ac0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4d5b358beb
commit
7227f722ac
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<R: io::Read>(reader: R) -> Result<types::HashSum> {
|
||||
use sha2::Digest;
|
||||
@@ -46,10 +48,11 @@ fn digest_file<R: io::Read>(reader: &mut R) -> io::Result<types::HashSum> {
|
||||
|
||||
#[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.
|
||||
|
||||
Reference in New Issue
Block a user