message: Rename body into value, since this applies to subject too.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-12 17:42:49 +02:00
parent c72f5819c7
commit f2f8de773b

View file

@ -152,14 +152,14 @@ impl Message {
return None; return None;
} }
for lang in preferred_langs { for lang in preferred_langs {
if let Some(body) = map.get(lang) { if let Some(value) = map.get(lang) {
return Some((Lang::from(lang), body)); return Some((Lang::from(lang), value));
} }
} }
if let Some(body) = map.get("") { if let Some(value) = map.get("") {
return Some((Lang::new(), body)); return Some((Lang::new(), value));
} }
map.iter().map(|(lang, body)| (lang.clone(), body)).next() map.iter().map(|(lang, value)| (lang.clone(), value)).next()
} }
/// Returns the best matching body from a list of languages. /// Returns the best matching body from a list of languages.