From d91825684feb93c6df1667bde20b560517f28701 Mon Sep 17 00:00:00 2001 From: SARDONYX-sard <68905624+SARDONYX-sard@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:52:29 +0900 Subject: [PATCH] feat(backend): add processing for cases where space is to be included in the name --- cspell.jsonc | 1 + dar2oar_core/src/fs/mapping_table.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cspell.jsonc b/cspell.jsonc index c3ea462..7ba30d6 100644 --- a/cspell.jsonc +++ b/cspell.jsonc @@ -9,6 +9,7 @@ "multispace", "rfind", "Skyrim", + "splitn", "stperson", "tauri", "thiserror", diff --git a/dar2oar_core/src/fs/mapping_table.rs b/dar2oar_core/src/fs/mapping_table.rs index 9440cfb..b82e707 100644 --- a/dar2oar_core/src/fs/mapping_table.rs +++ b/dar2oar_core/src/fs/mapping_table.rs @@ -26,10 +26,10 @@ fn parse_mapping_table(table: &str) -> HashMap { continue; }; - let mapping: Vec<&str> = line.split_whitespace().collect(); + let mapping: Vec<&str> = line.splitn(2, ' ').collect(); let section_name = match mapping.get(1) { Some(val) => { - current_section_name = val.to_string(); + current_section_name = val.trim().to_string(); idx = 0; current_section_name.clone() }