Deny 2018 idioms

This commit is contained in:
Félix Saparelli 2022-04-13 22:59:43 +12:00
parent b374de6097
commit 009ef2356f
4 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,5 @@
#![deny(rust_2018_idioms)]
use std::env::var;
use miette::{IntoDiagnostic, Result};

View File

@ -69,7 +69,7 @@ pub async fn from_origin(path: impl AsRef<Path>) -> (Vec<IgnoreFile>, Vec<Error>
Ok(Some(path)) => match GitConfig::open(&path) {
Err(err) => errors.push(Error::new(ErrorKind::Other, err)),
Ok(config) => {
if let Ok(excludes) = config.value::<GitPath>("core", None, "excludesFile") {
if let Ok(excludes) = config.value::<GitPath<'_>>("core", None, "excludesFile") {
match excludes.interpolate(None) {
Ok(e) => {
discover_file(
@ -209,7 +209,7 @@ pub async fn from_environment() -> (Vec<IgnoreFile>, Vec<Error>) {
match GitConfig::from_env_paths(&options) {
Err(err) => errors.push(Error::new(ErrorKind::Other, err)),
Ok(config) => {
if let Ok(excludes) = config.value::<GitPath>("core", None, "excludesFile") {
if let Ok(excludes) = config.value::<GitPath<'_>>("core", None, "excludesFile") {
match excludes.interpolate(None) {
Ok(e) => {
if discover_file(

View File

@ -94,6 +94,7 @@
#![doc(html_favicon_url = "https://watchexec.github.io/logo:watchexec.svg")]
#![doc(html_logo_url = "https://watchexec.github.io/logo:watchexec.svg")]
#![warn(clippy::unwrap_used, missing_docs)]
#![deny(rust_2018_idioms)]
#![cfg_attr(not(target_os = "fuchsia"), forbid(unsafe_code))]
// see event::ProcessEnd for why this is disabled on fuchsia

View File

@ -50,7 +50,7 @@ impl<T> fmt::Debug for SwapLock<T>
where
T: fmt::Debug + Clone,
{
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
f.debug_struct("SwapLock")
.field("(watch)", &self.r)
.finish()