removed comment

This commit is contained in:
Candifloss 2024-09-25 13:18:52 +05:30
parent b572fa1cc2
commit 8c373462aa

View File

@ -50,29 +50,13 @@ impl Notification {
} }
// Key:Val pairs of actions // Key:Val pairs of actions
/*pub fn actions(&self) -> Vec<(String, String)> {
let mut actions: Vec<(String, String)> = vec![];
let acts = &self.actions;
let act_len = acts.len();
let mut i = 0;
while i < act_len {
// Action ID, used by the sender to id the clicked action
let action_id = &acts[i];
// Localised human-readable string that describes the action
let action_label = &acts[i + 1];
// Pair of (id, label)
let action_pair = (action_id.to_owned(), action_label.to_owned());
// Add it to the Vec
actions.push(action_pair);
i += 2;
}
actions
}
*/
pub fn actions(&self) -> Vec<(String, String)> { pub fn actions(&self) -> Vec<(String, String)> {
self.actions self.actions
.chunks(2) .chunks(2)
.map(|chunk| (chunk[0].clone(), chunk[1].clone())) .map(|chunk|
(chunk[0].clone(),
chunk[1].clone())
)
.collect() .collect()
} }