Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/lower.rs')
-rw-r--r--crates/hir-def/src/expr_store/lower.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-def/src/expr_store/lower.rs b/crates/hir-def/src/expr_store/lower.rs
index 2be7b9963b..95dd1e53ae 100644
--- a/crates/hir-def/src/expr_store/lower.rs
+++ b/crates/hir-def/src/expr_store/lower.rs
@@ -1802,10 +1802,10 @@ impl ExprCollector<'_> {
if ident.is_simple_ident() {
return ident
.name()
- .and_then(|name| Some(name.as_name()))
- .and_then(|hir_name| Some(Path::from(hir_name)))
- .and_then(|path| {
- Some(self.alloc_expr_from_pat(Expr::Path(path), ptr))
+ .map(|name| name.as_name())
+ .map(Path::from)
+ .map(|path| {
+ self.alloc_expr_from_pat(Expr::Path(path), ptr)
});
}