From 9539389e4fd1639f8de2eef004bcea3c7b58c018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aodhnait=20=C3=89ta=C3=ADn?= Date: Sun, 23 May 2021 00:25:57 +0100 Subject: [PATCH] Fix segmentation fault This segfault occurs in the future commits, but because it's more important, I'm commiting it first. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 34e9ba7..2dac40f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -315,7 +315,7 @@ enum Token { impl std::fmt::Display for Token { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { return match self { - token @ Token::IntegerLiteral(_) => write!(f, "{}", token), + Token::IntegerLiteral(s) => write!(f, "{}", s), token => write!(f, "{}", match token { Token::Plus => "+", Token::Semicolon => ";",