diff options
author | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-03-14 19:32:04 +0000 |
---|---|---|
committer | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-03-14 19:32:04 +0000 |
commit | ed705b967a85990b0e0d36187c9d64bba96f8046 (patch) | |
tree | ef47a81acfa74ab951a924b3687ba819eb1ed920 /src/archive.rs | |
parent | Switched to tar-rs 0.4.22 and propagate no-symlink argument to tar generation (diff) | |
download | miniserve-ed705b967a85990b0e0d36187c9d64bba96f8046.tar.gz miniserve-ed705b967a85990b0e0d36187c9d64bba96f8046.zip |
Cargo fmt
Diffstat (limited to '')
-rw-r--r-- | src/archive.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/archive.rs b/src/archive.rs index b351fb9..c536c2d 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -49,7 +49,7 @@ impl CompressionMethod { pub fn create_archive_file( method: &CompressionMethod, dir: &PathBuf, - skip_symlinks: bool + skip_symlinks: bool, ) -> Result<(String, Bytes), errors::CompressionError> { match method { CompressionMethod::TarGz => tgz_compress(&dir, skip_symlinks), @@ -57,7 +57,10 @@ pub fn create_archive_file( } /// Compresses a given folder in .tar.gz format -fn tgz_compress(dir: &PathBuf, skip_symlinks: bool) -> Result<(String, Bytes), errors::CompressionError> { +fn tgz_compress( + dir: &PathBuf, + skip_symlinks: bool, +) -> Result<(String, Bytes), errors::CompressionError> { let src_dir = dir.display().to_string(); let inner_folder = match dir.file_name() { Some(directory_name) => match directory_name.to_str() { @@ -88,7 +91,11 @@ fn tgz_compress(dir: &PathBuf, skip_symlinks: bool) -> Result<(String, Bytes), e } /// Creates a temporary tar file of a given directory, reads it and returns its content as bytes -fn tar(src_dir: String, inner_folder: String, skip_symlinks: bool) -> Result<Vec<u8>, errors::CompressionError> { +fn tar( + src_dir: String, + inner_folder: String, + skip_symlinks: bool, +) -> Result<Vec<u8>, errors::CompressionError> { // Create a TAR file of src_dir let mut tar_builder = Builder::new(Vec::new()); |