cargo fmt
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user