style(main): consistent brace omittal

This commit is contained in:
xeruf 2025-01-29 23:06:42 +01:00
parent 807df3069a
commit a7c6cf2f59

View file

@ -22,7 +22,7 @@ use rustyline::error::ReadlineError;
use rustyline::DefaultEditor; use rustyline::DefaultEditor;
use std::collections::{HashMap, VecDeque}; use std::collections::{HashMap, VecDeque};
use std::env; use std::env;
use std::env::{args}; use std::env::args;
use std::fs; use std::fs;
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader, Write}; use std::io::{BufRead, BufReader, Write};
@ -469,7 +469,7 @@ async fn main() -> Result<()> {
if tasks.custom_time.is_none() { tasks.move_up(); } if tasks.custom_time.is_none() { tasks.move_up(); }
} }
Some('&') => { Some('&') =>
match arg { match arg {
None => tasks.undo(), None => tasks.undo(),
Some(text) => { Some(text) => {
@ -506,9 +506,8 @@ async fn main() -> Result<()> {
} }
} }
} }
}
Some('@') => { Some('@') =>
match arg { match arg {
None => { None => {
let today = Timestamp::now() - 80_000; let today = Timestamp::now() - 80_000;
@ -538,10 +537,9 @@ async fn main() -> Result<()> {
} }
} }
} }
};
} }
Some('*') => { Some('*') =>
match arg { match arg {
None => match tasks.get_position() { None => match tasks.get_position() {
None => { None => {
@ -565,7 +563,6 @@ async fn main() -> Result<()> {
} }
} }
} }
}
Some('|') => Some('|') =>
match arg { match arg {
@ -590,13 +587,12 @@ async fn main() -> Result<()> {
} }
} }
Some('?') => { Some('?') =>
match arg { match arg {
None => tasks.set_state_filter(StateFilter::Default), None => tasks.set_state_filter(StateFilter::Default),
Some("?") => tasks.set_state_filter(StateFilter::All), Some("?") => tasks.set_state_filter(StateFilter::All),
Some(arg) => tasks.set_state_filter(StateFilter::State(arg.to_string())), Some(arg) => tasks.set_state_filter(StateFilter::State(arg.to_string())),
} }
}
Some('!') => Some('!') =>
match tasks.get_position() { match tasks.get_position() {
@ -631,11 +627,10 @@ async fn main() -> Result<()> {
} }
} }
Some('#') => { Some('#') =>
if !tasks.update_tags(arg_default.split_whitespace().map(Hashtag::from)) { if !tasks.update_tags(arg_default.split_whitespace().map(Hashtag::from)) {
continue; continue;
} }
}
Some('+') => Some('+') =>
match arg { match arg {
@ -681,7 +676,7 @@ async fn main() -> Result<()> {
continue 'repl; continue 'repl;
} }
Some(')') => { Some(')') =>
match arg { match arg {
None => tasks.move_to(None), None => tasks.move_to(None),
Some(arg) => { Some(arg) => {
@ -693,7 +688,6 @@ async fn main() -> Result<()> {
continue 'repl; continue 'repl;
} }
} }
}
Some('.') => { Some('.') => {
let (remaining, dots) = trim_start_count(&command, '.'); let (remaining, dots) = trim_start_count(&command, '.');
@ -722,7 +716,8 @@ async fn main() -> Result<()> {
} }
} }
Some('/') => if arg.is_none() { Some('/') =>
if arg.is_none() {
tasks.move_to(None); tasks.move_to(None);
} else { } else {
let (remaining, dots) = trim_start_count(&command, '/'); let (remaining, dots) = trim_start_count(&command, '/');