Skip to content

Commit 322960f

Browse files
committed
chore: fix rustfmt codestyle
1 parent 1b170ac commit 322960f

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

src/archive/ar.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ use crate::{
2121
};
2222

2323
/// Unpacks an ar archive into the given output folder
24-
pub fn unpack_archive(
25-
reader: Box<dyn Read>,
26-
output_folder: &Path,
27-
) -> crate::Result<Unpacked> {
24+
pub fn unpack_archive(reader: Box<dyn Read>, output_folder: &Path) -> crate::Result<Unpacked> {
2825
let mut archive = ar::Archive::new(reader);
2926
let mut files_unpacked = 0;
3027

3128
while let Some(entry_result) = archive.next_entry() {
3229
let mut entry = entry_result.map_err(|e| {
33-
FinalError::with_title("Failed to read ar archive")
34-
.detail(format!("Error reading ar entry: {e}"))
30+
FinalError::with_title("Failed to read ar archive").detail(format!("Error reading ar entry: {e}"))
3531
})?;
3632

3733
let identifier = String::from_utf8_lossy(entry.header().identifier())
@@ -70,9 +66,7 @@ pub fn unpack_archive(
7066
}
7167

7268
/// List contents of an ar archive
73-
pub fn list_archive<R: Read + Send + 'static>(
74-
reader: R,
75-
) -> impl Iterator<Item = crate::Result<FileInArchive>> {
69+
pub fn list_archive<R: Read + Send + 'static>(reader: R) -> impl Iterator<Item = crate::Result<FileInArchive>> {
7670
struct Files(Receiver<crate::Result<FileInArchive>>);
7771
impl Iterator for Files {
7872
type Item = crate::Result<FileInArchive>;
@@ -180,10 +174,12 @@ where
180174
// ar crate requires std::fs::File, so we get the inner file
181175
let mut std_file = file.into_parts().0;
182176

183-
builder.append_file(file_name.as_bytes(), &mut std_file).map_err(|err| {
184-
FinalError::with_title("Could not create ar archive")
185-
.detail(format!("Error adding file '{}': {err}", path.display()))
186-
})?;
177+
builder
178+
.append_file(file_name.as_bytes(), &mut std_file)
179+
.map_err(|err| {
180+
FinalError::with_title("Could not create ar archive")
181+
.detail(format!("Error adding file '{}': {err}", path.display()))
182+
})?;
187183
}
188184
env::set_current_dir(previous_location)?;
189185
}

src/commands/compress.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,7 @@ pub fn compress_files(
205205
io::copy(&mut vec_buffer, &mut writer)?;
206206
}
207207
Ar => {
208-
archive::ar::build_archive_from_paths(
209-
&files,
210-
output_path,
211-
&mut writer,
212-
file_visibility_policy,
213-
)?;
208+
archive::ar::build_archive_from_paths(&files, output_path, &mut writer, file_visibility_policy)?;
214209
writer.flush()?;
215210
}
216211
}

0 commit comments

Comments
 (0)