Skip to content

Commit 8280d0b

Browse files
committed
rust: avoid clone of reference
1 parent 2c5049c commit 8280d0b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/validation.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,7 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
668668
// We didn't build ctypes_test until 3.9.
669669
// We didn't build some test extensions until 3.9.
670670

671-
const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &[
672-
"_sha256",
673-
"_sha512",
674-
"parser"];
671+
const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["_sha256", "_sha512", "parser"];
675672

676673
const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
677674
"_peg_parser",
@@ -686,7 +683,10 @@ const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
686683
const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[
687684
"_sha256",
688685
"_sha512",
689-
"_uuid", "_xxsubinterpreters", "_zoneinfo"];
686+
"_uuid",
687+
"_xxsubinterpreters",
688+
"_zoneinfo",
689+
];
690690

691691
const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[
692692
"_sha256",
@@ -1499,7 +1499,6 @@ fn validate_extension_modules(
14991499
wanted.insert("_uuid");
15001500
}
15011501

1502-
15031502
// _wmi is Windows only on 3.12+.
15041503
if python_major_minor == "3.12" && is_windows {
15051504
wanted.insert("_wmi");
@@ -1542,10 +1541,9 @@ fn validate_json(json: &PythonJsonMain, triple: &str, is_debug: bool) -> Result<
15421541
}
15431542
}
15441543

1545-
let wanted_platform_tag = PLATFORM_TAG_BY_TRIPLE
1544+
let wanted_platform_tag = *PLATFORM_TAG_BY_TRIPLE
15461545
.get(triple)
1547-
.ok_or_else(|| anyhow!("platform tag not defined for triple {}", triple))?
1548-
.clone();
1546+
.ok_or_else(|| anyhow!("platform tag not defined for triple {}", triple))?;
15491547

15501548
if json.python_platform_tag != wanted_platform_tag {
15511549
errors.push(format!(

0 commit comments

Comments
 (0)