Skip to content

Commit b1def84

Browse files
committed
Refactor should_generate_flatpakref to use a constant for unwanted extensions
1 parent 72ef200 commit b1def84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jobs/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ use super::job_queue::queue_update_job;
2323
/// **Both the commit job and the publish job use this predicate** to decide which refs get a
2424
/// `.flatpakref` file.
2525
pub fn should_generate_flatpakref(ref_name: &str) -> bool {
26-
let unwanted_exts = [".Debug", ".Locale", ".Sources", ".Docs"];
26+
const UNWANTED_EXTS: &[&str] = &[".Debug", ".Locale", ".Sources", ".Docs"];
2727
let ref_id = ref_name.split('/').nth(1).unwrap_or("");
2828

2929
ref_name.starts_with("app/")
3030
|| (ref_name.starts_with("runtime/")
31-
&& !unwanted_exts.iter().any(|&ext| ref_id.ends_with(ext)))
31+
&& !UNWANTED_EXTS.iter().any(|&ext| ref_id.ends_with(ext)))
3232
}
3333

3434
pub fn generate_flatpakref(

0 commit comments

Comments
 (0)