From bd2f866c6807875b93cf0136ee84483a99671a3d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 8 Aug 2022 10:55:21 +1000 Subject: [PATCH] Fix {{CardFlags}} not working with flags 5-7 https://forums.ankiweb.net/t/please-activate-flags-5-7-on-the-cardflag/22143 --- rslib/src/notetype/render.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rslib/src/notetype/render.rs b/rslib/src/notetype/render.rs index 2ef54cb07..9083d9080 100644 --- a/rslib/src/notetype/render.rs +++ b/rslib/src/notetype/render.rs @@ -161,14 +161,8 @@ impl Collection { } } -fn flag_name(n: u8) -> &'static str { - match n { - 1 => "flag1", - 2 => "flag2", - 3 => "flag3", - 4 => "flag4", - _ => "", - } +fn flag_name(n: u8) -> String { + format!("flag{n}") } fn fill_empty_fields(note: &mut Note, qfmt: &str, nt: &Notetype, tr: &I18n) {