🐛 Fixed is_some() issues
This commit is contained in:
parent
70760e1aa3
commit
109dbdabbb
@ -14,16 +14,6 @@ fn parse_tags(tags: Option<String>) -> Option<Vec<String>> {
|
||||
pub fn show(tasks: &mut Tasks, id: Option<usize>) -> Result<(), TasksError> {
|
||||
// If no id is given, print out all tasks
|
||||
if let Some(..) = id {
|
||||
if tasks.is_empty() {
|
||||
// Output when no tasks are available
|
||||
output::info(String::from("no tasks found"))
|
||||
} else {
|
||||
// Generate the table of all tasks
|
||||
let table = tables::tasks_table(tasks);
|
||||
// Print the table
|
||||
println!("{}", table);
|
||||
};
|
||||
} else {
|
||||
// Get the task the user wants to see
|
||||
let id = id.unwrap();
|
||||
let task = tasks.get_task(id)?;
|
||||
@ -32,6 +22,14 @@ pub fn show(tasks: &mut Tasks, id: Option<usize>) -> Result<(), TasksError> {
|
||||
let table = tables::task_table(task, id);
|
||||
// Print the table
|
||||
println!("{}", table);
|
||||
} else if tasks.is_empty() {
|
||||
// Output when no tasks are available
|
||||
output::info(String::from("no tasks found"))
|
||||
} else {
|
||||
// Generate the table of all tasks
|
||||
let table = tables::tasks_table(tasks);
|
||||
// Print the table
|
||||
println!("{}", table);
|
||||
};
|
||||
|
||||
// Success
|
||||
|
@ -103,7 +103,7 @@ impl Task {
|
||||
}
|
||||
|
||||
pub fn stop(&mut self) {
|
||||
if self.when.is_none() {
|
||||
if self.when.is_some() {
|
||||
self.status = Status::Inbox;
|
||||
} else {
|
||||
self.status = Status::Pending;
|
||||
|
Loading…
Reference in New Issue
Block a user