Skip to content

Commit 518d0df

Browse files
committed
Improve readability
1 parent ae487e3 commit 518d0df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/patch/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,11 @@ impl Spec for str {
804804
}
805805

806806
fn opt_interpolate<T: Interpolate>(path: &Option<&T>, s: Option<&str>) -> Option<String> {
807-
path.and_then(|path| path.interpolate_opt(s))
808-
.or_else(|| s.map(ToString::to_string))
807+
if let Some(path) = path {
808+
path.interpolate_opt(s)
809+
} else {
810+
s.map(ToString::to_string)
811+
}
809812
}
810813

811814
trait Interpolate {

0 commit comments

Comments
 (0)