mirror of https://github.com/fafhrd91/actix-web
use if let vs match
This commit is contained in:
parent
b04bc9af21
commit
deb09109f6
|
@ -133,9 +133,12 @@ impl Logger {
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let inner = Rc::get_mut(&mut self.0).unwrap();
|
let inner = Rc::get_mut(&mut self.0).unwrap();
|
||||||
|
|
||||||
let pos = inner.format.0.iter().position(|tf| match tf {
|
let pos = inner.format.0.iter().position(|tf| {
|
||||||
FormatText::CustomRequest(inner_label, _) => label == inner_label,
|
if let FormatText::CustomRequest(inner_label, _) = tf {
|
||||||
_ => false,
|
label == inner_label
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
match pos {
|
match pos {
|
||||||
Some(pos) => match &mut inner.format.0[pos] {
|
Some(pos) => match &mut inner.format.0[pos] {
|
||||||
|
|
Loading…
Reference in New Issue