mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
fix new clippy warnings
This commit is contained in:
parent
7ed2bf4441
commit
c42cc3bdcb
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
// Nested functions that always return Ok(..) are used as callbacks in a context where a Result is
|
||||
// expected, so the unnecessary_wraps clippy lint is not useful here.
|
||||
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
/*!
|
||||
|
||||
This module is responsible for parsing command lines (`Arglist`, an alias for `&[&str]`) into `Command` instances.
|
||||
|
|
|
@ -23,7 +23,7 @@ pub(crate) fn invoke(command: Command, settings: Config) -> anyhow::Result<()> {
|
|||
log::debug!("command: {:?}", command);
|
||||
log::debug!("settings: {:?}", settings);
|
||||
|
||||
let mut w = get_writer()?;
|
||||
let mut w = get_writer();
|
||||
|
||||
// This function examines the command and breaks out the necessary bits to call one of the
|
||||
// `execute` functions in a submodule of `cmd`.
|
||||
|
@ -136,10 +136,10 @@ fn get_server(settings: &Config) -> anyhow::Result<Box<dyn Server>> {
|
|||
}
|
||||
|
||||
/// Get a WriteColor implementation based on whether the output is a tty.
|
||||
fn get_writer() -> anyhow::Result<StandardStream> {
|
||||
Ok(StandardStream::stdout(if atty::is(atty::Stream::Stdout) {
|
||||
fn get_writer() -> StandardStream {
|
||||
StandardStream::stdout(if atty::is(atty::Stream::Stdout) {
|
||||
ColorChoice::Auto
|
||||
} else {
|
||||
ColorChoice::Never
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue