Skip to content

Commit 2992372

Browse files
committed
Format
1 parent 93b8923 commit 2992372

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

build.rs

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,31 @@ fn main() -> Result<()> {
7272
})?;
7373
println!("cargo:warning={:?} = {:?}", str, version.trim());
7474
}
75-
if str == CORE_TGZ
76-
&& !bundled_core_path.exists() {
77-
println!("cargo:info=Found core.tar.gz in archive, extracting to core",);
78-
let core_tgz_path = PathBuf::from(out_dir.clone()).join("core.tar.gz");
79-
entry.unpack(&core_tgz_path).with_context(|| {
80-
format!("Failed to unpack file {:?} to {:?}", path, core_tgz_path)
81-
})?;
82-
let bytes = std::fs::read(core_tgz_path)
83-
.with_context(|| format!("Failed to read file {:?}", path))?;
84-
let core_tar = GzDecoder::new(bytes.as_slice());
85-
let mut core_archive = Archive::new(core_tar);
75+
if str == CORE_TGZ && !bundled_core_path.exists() {
76+
println!("cargo:info=Found core.tar.gz in archive, extracting to core",);
77+
let core_tgz_path = PathBuf::from(out_dir.clone()).join("core.tar.gz");
78+
entry.unpack(&core_tgz_path).with_context(|| {
79+
format!("Failed to unpack file {:?} to {:?}", path, core_tgz_path)
80+
})?;
81+
let bytes = std::fs::read(core_tgz_path)
82+
.with_context(|| format!("Failed to read file {:?}", path))?;
83+
let core_tar = GzDecoder::new(bytes.as_slice());
84+
let mut core_archive = Archive::new(core_tar);
8685

87-
let core_target = manifest_path.clone();
88-
let core_dir = manifest_path.join("core");
89-
if core_dir.exists() {
90-
std::fs::remove_dir_all(core_dir).with_context(|| {
91-
format!(
92-
"Failed to remove directory {:?}",
93-
manifest_path.join("core")
94-
)
95-
})?;
96-
}
97-
core_archive.unpack(&core_target).with_context(|| {
98-
format!("Failed to unpack file {:?} to {:?}", path, core_target)
86+
let core_target = manifest_path.clone();
87+
let core_dir = manifest_path.join("core");
88+
if core_dir.exists() {
89+
std::fs::remove_dir_all(core_dir).with_context(|| {
90+
format!(
91+
"Failed to remove directory {:?}",
92+
manifest_path.join("core")
93+
)
9994
})?;
10095
}
96+
core_archive.unpack(&core_target).with_context(|| {
97+
format!("Failed to unpack file {:?} to {:?}", path, core_target)
98+
})?;
99+
}
101100
}
102101
}
103102

0 commit comments

Comments
 (0)