From 3fbdc20859a7f795ab9396ead363ab7a9581405d Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 2 Nov 2022 15:05:38 +0100 Subject: Fix reading the deck when it contains a minus --- src/deck.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/deck.rs b/src/deck.rs index 70dfda1..82566bd 100644 --- a/src/deck.rs +++ b/src/deck.rs @@ -39,7 +39,7 @@ pub fn read(deck: &str) -> Result> { message: "an entry should starts with “-”.".to_string(), })); } else { - let without_minus = line.split('-').collect::>()[1].trim(); + let without_minus = line.split('-').skip(1).collect::>().join("-"); let without_comment = without_minus.split('#').collect::>()[0].trim(); let translation = without_comment.split(':').collect::>(); if translation.len() != 2 { -- cgit v1.2.3