From 7d631b1d2425bfcd16ecb77eae8e82aed750b771 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 21 Feb 2021 17:53:43 +0300 Subject: [PATCH] fix: future clippy warnings --- migra-cli/src/commands/list.rs | 2 +- migra-cli/src/config.rs | 2 +- migra-cli/src/migration.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/migra-cli/src/commands/list.rs b/migra-cli/src/commands/list.rs index 128149a..dd4bf6f 100644 --- a/migra-cli/src/commands/list.rs +++ b/migra-cli/src/commands/list.rs @@ -26,7 +26,7 @@ pub(crate) fn print_migration_lists(config: Config) -> StdResult<()> { Vec::new() } - Err(e) => panic!(e), + Err(e) => panic!("{}", e), }; println!(); diff --git a/migra-cli/src/config.rs b/migra-cli/src/config.rs index e752bf5..0724f39 100644 --- a/migra-cli/src/config.rs +++ b/migra-cli/src/config.rs @@ -139,7 +139,7 @@ impl Config { let migrations = entries .iter() - .filter_map(Migration::new) + .filter_map(|path| Migration::new(&path)) .collect::>(); Ok(migrations) diff --git a/migra-cli/src/migration.rs b/migra-cli/src/migration.rs index 3ec7556..d42390a 100644 --- a/migra-cli/src/migration.rs +++ b/migra-cli/src/migration.rs @@ -5,7 +5,7 @@ use crate::path::PathBuilder; use crate::StdResult; use std::convert::TryFrom; use std::fs; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; #[derive(Debug)] pub struct Migration { @@ -15,7 +15,7 @@ pub struct Migration { } impl Migration { - pub(crate) fn new(directory: &PathBuf) -> Option { + pub(crate) fn new(directory: &Path) -> Option { if directory.is_dir() { let name = directory .file_name()