Server: Use max/min for language parsing
rather than clamp. This allows us to compile on stable
This commit is contained in:
parent
85d01fd3f0
commit
abf7377f0d
|
@ -102,7 +102,7 @@ fn parse_accept_language(s: &str) -> Vec<LanguageIdentifier> {
|
|||
let quality = lang_iter.next();
|
||||
|
||||
let quality_value: f32 = if let Some(quality) = quality {
|
||||
quality.parse::<f32>().ok()?.clamp(0.0f32, 1.0f32)
|
||||
quality.parse::<f32>().ok()?.max(0.0f32).min(1.0f32)
|
||||
} else {
|
||||
1.0f32
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue