Skip to content

Commit 9ca6a24

Browse files
linux
1 parent 6c13638 commit 9ca6a24

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

crates/packager/src/package/appimage/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub(crate) fn package(ctx: &Context) -> crate::Result<Vec<PathBuf>> {
158158
.and_then(|a| a.excluded_libs.clone())
159159
.unwrap_or_default()
160160
.into_iter()
161-
.map(|library| format!("--exclude-library {}", library))
161+
.map(|library| format!("--exclude-library {library}"))
162162
.collect::<Vec<_>>()
163163
.join(" ");
164164
sh_map.insert("excluded_libs", to_json(excluded_libraries));

crates/packager/src/package/deb/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn generate_icon_files(config: &Config, data_dir: &Path) -> crate::Result<BTreeS
9393
#[tracing::instrument(level = "trace", skip(config))]
9494
fn generate_desktop_file(config: &Config, data_dir: &Path) -> crate::Result<()> {
9595
let bin_name = config.main_binary_name()?;
96-
let desktop_file_name = format!("{}.desktop", bin_name);
96+
let desktop_file_name = format!("{bin_name}.desktop");
9797
let desktop_file_path = data_dir
9898
.join("usr/share/applications")
9999
.join(desktop_file_name);
@@ -304,24 +304,24 @@ fn generate_control_file(
304304
let mut file = util::create_file(&dest_path)?;
305305
writeln!(file, "Package: {}", AsKebabCase(&config.product_name))?;
306306
writeln!(file, "Version: {}", &config.version)?;
307-
writeln!(file, "Architecture: {}", arch)?;
307+
writeln!(file, "Architecture: {arch}")?;
308308
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
309309
writeln!(file, "Installed-Size: {}", get_size(data_dir)? / 1024)?;
310310
if let Some(authors) = &config.authors {
311311
writeln!(file, "Maintainer: {}", authors.join(", "))?;
312312
}
313313
if let Some(section) = config.deb().and_then(|d| d.section.as_ref()) {
314-
writeln!(file, "Section: {}", section)?;
314+
writeln!(file, "Section: {section}")?;
315315
}
316316

317317
if let Some(priority) = config.deb().and_then(|d| d.priority.as_ref()) {
318-
writeln!(file, "Priority: {}", priority)?;
318+
writeln!(file, "Priority: {priority}")?;
319319
} else {
320320
writeln!(file, "Priority: optional")?;
321321
}
322322

323323
if let Some(homepage) = &config.homepage {
324-
writeln!(file, "Homepage: {}", homepage)?;
324+
writeln!(file, "Homepage: {homepage}")?;
325325
}
326326
if let Some(depends) = config.deb().and_then(|d| d.depends.as_ref()) {
327327
let dependencies = depends.to_list()?;
@@ -345,7 +345,7 @@ fn generate_control_file(
345345
if line.is_empty() {
346346
writeln!(file, " .")?;
347347
} else {
348-
writeln!(file, " {}", line)?;
348+
writeln!(file, " {line}")?;
349349
}
350350
}
351351
file.flush()?;
@@ -368,14 +368,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
368368
let mut hash = md5::Context::new();
369369
std::io::copy(&mut file, &mut hash)?;
370370
for byte in hash.compute().iter() {
371-
write!(md5sums_file, "{:02x}", byte)?;
371+
write!(md5sums_file, "{byte:02x}")?;
372372
}
373373
let rel_path = path.strip_prefix(data_dir)?;
374374
let path_str = rel_path.to_str().ok_or_else(|| {
375-
let msg = format!("Non-UTF-8 path: {:?}", rel_path);
375+
let msg = format!("Non-UTF-8 path: {rel_path:?}");
376376
std::io::Error::new(std::io::ErrorKind::InvalidData, msg)
377377
})?;
378-
writeln!(md5sums_file, " {}", path_str)?;
378+
writeln!(md5sums_file, " {path_str}")?;
379379
}
380380
Ok(())
381381
}

crates/packager/src/package/pacman/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) fn package(ctx: &Context) -> crate::Result<Vec<PathBuf>> {
3030
util::create_clean_dir(&intermediates_path)?;
3131

3232
let package_base_name = format!("{}_{}_{}", config.main_binary_name()?, config.version, arch);
33-
let package_name = format!("{}.tar.gz", package_base_name);
33+
let package_name = format!("{package_base_name}.tar.gz");
3434

3535
let pkg_dir = intermediates_path.join(&package_base_name);
3636
let pkg_path = config.out_dir().join(&package_name);
@@ -82,10 +82,10 @@ fn generate_pkgbuild_file(
8282
"pkgdesc=\"{}\"",
8383
config.description.as_deref().unwrap_or("")
8484
)?;
85-
writeln!(file, "arch=('{}')", arch)?;
85+
writeln!(file, "arch=('{arch}')")?;
8686

8787
if let Some(homepage) = &config.homepage {
88-
writeln!(file, "url=\"{}\"", homepage)?;
88+
writeln!(file, "url=\"{homepage}\"")?;
8989
}
9090

9191
let dependencies = config
@@ -131,7 +131,7 @@ fn generate_pkgbuild_file(
131131
io::copy(&mut sha_file, &mut sha512)?;
132132
let sha_hash = sha512.finalize();
133133

134-
writeln!(file, "sha512sums=(\"{:x}\")", sha_hash)?;
134+
writeln!(file, "sha512sums=(\"{sha_hash:x}\")")?;
135135
writeln!(
136136
file,
137137
"package() {{\n\tcp -r \"${{srcdir}}\"/* \"${{pkgdir}}\"/\n}}"

0 commit comments

Comments
 (0)