diff options
author | Vika <vika@fireburn.ru> | 2025-04-09 23:31:02 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-04-09 23:31:57 +0300 |
commit | 8826d9446e6c492db2243b9921e59ce496027bef (patch) | |
tree | 63738aa9001cb73b11cb0e974e93129bcdf1adbb /templates/build.rs | |
parent | 519cadfbb298f50cbf819dde757037ab56e2863e (diff) | |
download | kittybox-8826d9446e6c492db2243b9921e59ce496027bef.tar.zst |
cargo fmt
Change-Id: I80e81ebba3f0cdf8c094451c9fe3ee4126b8c888
Diffstat (limited to 'templates/build.rs')
-rw-r--r-- | templates/build.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/templates/build.rs b/templates/build.rs index 5a62855..057666b 100644 --- a/templates/build.rs +++ b/templates/build.rs @@ -22,8 +22,7 @@ fn main() -> Result<(), std::io::Error> { println!("cargo:rerun-if-changed=assets/"); let assets_path = std::path::Path::new("assets"); - let mut assets = WalkDir::new(assets_path) - .into_iter(); + let mut assets = WalkDir::new(assets_path).into_iter(); while let Some(Ok(entry)) = assets.next() { eprintln!("Processing {}", entry.path().display()); let out_path = out_dir.join(entry.path().strip_prefix(assets_path).unwrap()); @@ -31,11 +30,15 @@ fn main() -> Result<(), std::io::Error> { eprintln!("Creating directory {}", &out_path.display()); if let Err(err) = std::fs::create_dir(&out_path) { if err.kind() != std::io::ErrorKind::AlreadyExists { - return Err(err) + return Err(err); } } } else { - eprintln!("Copying {} to {}", entry.path().display(), out_path.display()); + eprintln!( + "Copying {} to {}", + entry.path().display(), + out_path.display() + ); std::fs::copy(entry.path(), &out_path)?; } } @@ -43,16 +46,11 @@ fn main() -> Result<(), std::io::Error> { let walker = WalkDir::new(&out_dir) .into_iter() .map(Result::unwrap) - .filter(|e| { - e.file_type().is_file() && e.path().extension().unwrap() != "gz" - }); + .filter(|e| e.file_type().is_file() && e.path().extension().unwrap() != "gz"); for entry in walker { let normal_path = entry.path(); let gzip_path = normal_path.with_extension({ - let mut extension = normal_path - .extension() - .unwrap() - .to_owned(); + let mut extension = normal_path.extension().unwrap().to_owned(); extension.push(OsStr::new(".gz")); extension }); |