Skip to content

Commit 1e082f6

Browse files
committed
Use match instead of if-let
1 parent 43793c0 commit 1e082f6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

fathom/src/core/pretty.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,9 @@ impl<'interner, 'arena> Context<'interner> {
180180
RcDoc::concat([
181181
RcDoc::concat([
182182
self.plicity(*plicity),
183-
if let Some(name) = param_name {
184-
self.string_id(*name)
185-
} else {
186-
RcDoc::nil()
183+
match param_name {
184+
Some(name) => self.string_id(*name),
185+
None => RcDoc::text("_"),
187186
},
188187
RcDoc::space(),
189188
RcDoc::text(":"),
@@ -208,10 +207,9 @@ impl<'interner, 'arena> Context<'interner> {
208207
RcDoc::text("fun"),
209208
RcDoc::space(),
210209
self.plicity(*plicity),
211-
if let Some(name) = param_name {
212-
self.string_id(*name)
213-
} else {
214-
RcDoc::nil()
210+
match param_name {
211+
Some(name) => self.string_id(*name),
212+
None => RcDoc::text("_"),
215213
},
216214
RcDoc::space(),
217215
RcDoc::text("=>"),

0 commit comments

Comments
 (0)