This commit is contained in:
Candifloss 2024-09-28 16:49:48 +05:30
parent 1e51c83067
commit 21002f6521

View File

@ -10,9 +10,9 @@ where
{ {
let mut map = serde_json::Map::new(); let mut map = serde_json::Map::new();
// Assuming actions are in pairs: [id, label, id, label, ...] // Actions are in pairs: [id, label, id, label, ...]
for chunk in actions.chunks(2) { for pair in actions.chunks(2) {
if let [id, label] = chunk { if let [id, label] = pair {
map.insert(id.clone(), serde_json::Value::String(label.clone())); map.insert(id.clone(), serde_json::Value::String(label.clone()));
} }
} }