use crate::{CurrentTaskInfo, Task}; pub struct Request { pub tasks: Vec, pub current_task_info: Option, } pub fn execute(req: Request) { for (i, task) in req.tasks.iter().enumerate() { let idx = i + 1; match req.current_task_info { Some(CurrentTaskInfo { task_idx, .. }) if task_idx == idx => print!("> "), _ => print!(" "), } print!("{}. ", idx); if task.link.is_some() { print!("(link) "); } println!("{}", task.name); } }