Skip to content

Commit 4d49c9b

Browse files
committed
Fix maximize in negotiation
1 parent c8b540e commit 4d49c9b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/negotiate/likely_subtags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ static REGION_MATCHING_KEYS: &[&str] = &[
55
];
66

77
pub trait MockLikelySubtags {
8-
fn add_likely_subtags(&mut self) -> bool;
8+
fn maximize(&mut self) -> bool;
99
}
1010

1111
impl MockLikelySubtags for LanguageIdentifier {
12-
fn add_likely_subtags(&mut self) -> bool {
12+
fn maximize(&mut self) -> bool {
1313
let extended = match self.to_string().as_str() {
1414
"en" => "en-Latn-US",
1515
"fr" => "fr-Latn-FR",

src/negotiate/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub fn filter_matches<'a, R: 'a + AsRef<LanguageIdentifier>, A: 'a + AsRef<Langu
186186
}
187187

188188
// 3) Try to match against a maximized version of the requested locale
189-
if req.add_likely_subtags() {
189+
if req.maximize() {
190190
test_strategy!(true, false);
191191
}
192192

@@ -196,7 +196,7 @@ pub fn filter_matches<'a, R: 'a + AsRef<LanguageIdentifier>, A: 'a + AsRef<Langu
196196

197197
// 5) Try to match against the likely subtag without region
198198
req.clear_region();
199-
if req.add_likely_subtags() {
199+
if req.maximize() {
200200
test_strategy!(true, false);
201201
}
202202

0 commit comments

Comments
 (0)