I learned about misusing the code
io::stdin().read_line(&mut String::new()).unwrap();
to make it wait for an input but I'm having issues on implementing it in my block of code in main.rs or cli.rs, everywhere I place it, it seems to either block modules or tells me it expects an identifier, any help on where it would go to block console from exiting?
use structopt::StructOpt;
mod cli;
mod task;
use cli::{Action::*, CommandLineArgs};
use task::Task;
io::stdin::read_line.&mut String::new().unwrap();
fn main() {
// Get the command-line arguments.
let CommandLineArgs {
action,
todo_file,
} = CommandLineArgs::from_args();
// Unpack the todo file.
let todo_file = todo_file.expect("Failed to find todo file");
// Perform the action.
match action {
Add { text } => task::add_task(todo_file, Task::new(text)),
List => task::list_tasks(todo_file),
Done { position } => task::complete_task(todo_file, position),
}
.expect("Failed to perform action")