From 34a98217249cf3a7af292b88c28d698ad5adbfb0 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Sun, 4 Feb 2024 08:53:10 -0500 Subject: [PATCH] Ignore extra whitespace around tokens. --- src/mfvi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mfvi.rs b/src/mfvi.rs index 474aea1..346ac8b 100644 --- a/src/mfvi.rs +++ b/src/mfvi.rs @@ -7,8 +7,8 @@ pub fn replace_chars(input: &str) -> String { let trs: Vec> = input .lines() .filter_map(|line| { - line.strip_prefix("#REPLACE ") - .and_then(|l| l.rsplit_once(' ')) + line.strip_prefix("#REPLACE") + .and_then(|l| l.trim().rsplit_once(' ')) .and_then(|(first, second)| { let length = std::cmp::min(first.len(), second.len()); Some(Translation {