fmt: apply rustfmt
This commit is contained in:
+2
-10
@@ -160,21 +160,13 @@ fn copy_file_times(src: &Path, dest: &Path) -> Result<(), Box<dyn Error>> {
|
|||||||
fn component_addon(name: &str) -> Option<&str> {
|
fn component_addon(name: &str) -> Option<&str> {
|
||||||
let rest = name.split_once(".orig-")?.1;
|
let rest = name.split_once(".orig-")?.1;
|
||||||
let addon = rest.split(".tar.").next()?;
|
let addon = rest.split(".tar.").next()?;
|
||||||
if addon.is_empty() {
|
if addon.is_empty() { None } else { Some(addon) }
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(addon)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move the contents of an archive's wrapper directory into `dir`, or into
|
/// Move the contents of an archive's wrapper directory into `dir`, or into
|
||||||
/// `dir/<addon>` for a multi-orig component, replacing any pre-existing
|
/// `dir/<addon>` for a multi-orig component, replacing any pre-existing
|
||||||
/// addon directory.
|
/// addon directory.
|
||||||
fn unwrap_into(
|
fn unwrap_into(dir: &Path, wrapper: &Path, addon: Option<&str>) -> Result<(), Box<dyn Error>> {
|
||||||
dir: &Path,
|
|
||||||
wrapper: &Path,
|
|
||||||
addon: Option<&str>,
|
|
||||||
) -> Result<(), Box<dyn Error>> {
|
|
||||||
let target = match addon {
|
let target = match addon {
|
||||||
Some(addon) => {
|
Some(addon) => {
|
||||||
let target = dir.join(addon);
|
let target = dir.join(addon);
|
||||||
|
|||||||
Reference in New Issue
Block a user