From 81e5dc426a9b7b59c33f762a0b7ebf473a993b2a Mon Sep 17 00:00:00 2001 From: Eduardo Sandalo Porto Date: Thu, 4 Jul 2024 18:36:48 -0300 Subject: [PATCH] Slightly improve explanation comment --- src/fun/transform/fix_match_terms.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fun/transform/fix_match_terms.rs b/src/fun/transform/fix_match_terms.rs index 8a94c0cf..f655bf35 100644 --- a/src/fun/transform/fix_match_terms.rs +++ b/src/fun/transform/fix_match_terms.rs @@ -166,10 +166,12 @@ impl Term { let with_bnd = std::mem::take(with_bnd); let with_arg = std::mem::take(with_arg); + // Replaces `self` by its irrefutable arm + *self = std::mem::take(&mut arms[0].2); + // `with` clause desugaring // Performs the same as `Term::linearize_match_with`. // Note that it only wraps the arm with function calls if `with_bnd` and `with_arg` aren't empty. - *self = std::mem::take(&mut arms[0].2); *self = Term::rfold_lams(std::mem::take(self), with_bnd.into_iter()); *self = Term::call(std::mem::take(self), with_arg);