Use or_else() instead of or()
This commit is contained in:
parent
775508a6ed
commit
42c4186dec
1 changed files with 6 additions and 1 deletions
|
@ -75,7 +75,12 @@ impl IntoKeyValue<String, String> for String {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
R.captures(&self[..])
|
R.captures(&self[..])
|
||||||
.map(|c| c.name("VALUE").or(c.name("QVALUE")).map(|m| m.as_str()).unwrap_or(""))
|
.map(|c| {
|
||||||
|
c.name("VALUE")
|
||||||
|
.or_else(|| c.name("QVALUE"))
|
||||||
|
.map(|m| m.as_str())
|
||||||
|
.unwrap_or("")
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
key.and_then(|k| {
|
key.and_then(|k| {
|
||||||
|
|
Loading…
Reference in a new issue