From 5b7b3be6f9623ccb04bf96972f08f6146cf866dd Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 4 Jul 2024 14:30:34 +0800 Subject: [PATCH] fix: useseq error --- src-tauri/src/enhance/seq.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/enhance/seq.rs b/src-tauri/src/enhance/seq.rs index 1aa1785..c253b1e 100644 --- a/src-tauri/src/enhance/seq.rs +++ b/src-tauri/src/enhance/seq.rs @@ -16,14 +16,7 @@ pub fn use_seq(seq_map: SeqMap, config: Mapping, name: &str) -> Mapping { val.as_sequence().unwrap_or(&Sequence::default()).clone() }); let mut seq = origin_seq.clone(); - prepend.reverse(); - for item in prepend { - seq.insert(0, item); - } - for item in append { - seq.push(item); - } let mut delete_names = Vec::new(); for item in delete { let item = item.clone(); @@ -47,6 +40,15 @@ pub fn use_seq(seq_map: SeqMap, config: Mapping, name: &str) -> Mapping { } }); + prepend.reverse(); + for item in prepend { + seq.insert(0, item); + } + + for item in append { + seq.push(item); + } + let mut config = config.clone(); config.insert(Value::from(name), Value::from(seq)); return config;