From bb550200b33e79f98f4e70ef2d7c16af27af0cd4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 19 Oct 2024 13:37:13 +0100 Subject: [PATCH] Fixed borrow issue --- src/combinator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/combinator.rs b/src/combinator.rs index 9cd07183..9d5d39c1 100644 --- a/src/combinator.rs +++ b/src/combinator.rs @@ -823,7 +823,8 @@ where let res = self.parser.go::(inp); if res.is_err() { - inp.memos.insert(key, Some(inp.take_alt())); + let alt = inp.take_alt(); + inp.memos.insert(key, Some(alt)); } else { inp.memos.remove(&key); }