cargo fmt

This commit is contained in:
dbr
2021-03-25 17:10:11 +11:00
parent 0e7a4c2c33
commit 6d77b9a319
9 changed files with 43 additions and 18 deletions

View File

@@ -32,10 +32,7 @@ impl Command {
pub fn from_argv(argv: &[&str]) -> anyhow::Result<Command> {
match Command::parse(argv) {
Ok((&[], cmd)) => Ok(cmd),
Ok((trailing, _)) => bail!(
"command line has trailing arguments: {:?}",
trailing
),
Ok((trailing, _)) => bail!("command line has trailing arguments: {:?}", trailing),
Err(Err::Incomplete(_)) => unreachable!(),
Err(Err::Error(e)) => bail!("command line not recognized: {:?}", e),
Err(Err::Failure(e)) => bail!("command line not recognized: {:?}", e),

View File

@@ -1,7 +1,7 @@
//! This module contains the data structures used to define reports.
use crate::argparse::{Condition, Filter};
use anyhow::{bail};
use anyhow::bail;
/// A report specifies a filter as well as a sort order and information about which
/// task attributes to display
@@ -85,7 +85,9 @@ impl Report {
.map_err(|e| anyhow::anyhow!(".sort: {}", e))?
.drain(..)
.enumerate()
.map(|(i, v)| Sort::from_config(v).map_err(|e| anyhow::anyhow!(".sort[{}]{}", i, e)))
.map(|(i, v)| {
Sort::from_config(v).map_err(|e| anyhow::anyhow!(".sort[{}]{}", i, e))
})
.collect::<anyhow::Result<Vec<_>>>()?
} else {
vec![]
@@ -98,7 +100,9 @@ impl Report {
.map_err(|e| anyhow::anyhow!(".columns: {}", e))?
.drain(..)
.enumerate()
.map(|(i, v)| Column::from_config(v).map_err(|e| anyhow::anyhow!(".columns[{}]{}", i, e)))
.map(|(i, v)| {
Column::from_config(v).map_err(|e| anyhow::anyhow!(".columns[{}]{}", i, e))
})
.collect::<anyhow::Result<Vec<_>>>()?;
let conditions = if let Some(conditions) = map.remove("filter") {