Function accept_language::parse_with_quality
source · pub fn parse_with_quality(raw_languages: &str) -> Vec<(String, f32)>
Expand description
Similar to parse
but with quality f32
appended to notice if it is a default value.
is used by intersection_with_quality
and
intersection_ordered_with_quality
.
Example
use accept_language::parse_with_quality;
let user_languages = parse_with_quality("en-US, en-GB;q=0.5");
assert_eq!(user_languages,vec![(String::from("en-US"), 1.0), (String::from("en-GB"), 0.5)])