Skip to content

Commit 7071802

Browse files
charliermarshindygreg
authored andcommitted
Avoid incorrect triple match for substrings
1 parent d09ff92 commit 7071802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/github.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
204204

205205
let name = zf.name().to_string();
206206

207-
if let Some((triple, release)) = RELEASE_TRIPLES.iter().find_map(|(triple, release)| {
207+
// Iterate over `RELEASE_TRIPLES` in reverse-order to ensure that if any triple is a
208+
// substring of another, the longest match is used.
209+
if let Some((triple, release)) = RELEASE_TRIPLES.iter().rev().find_map(|(triple, release)| {
208210
if name.contains(triple) {
209211
Some((triple, release))
210212
} else {

0 commit comments

Comments
 (0)