Archived
1
0
Fork 0

fix: future clippy warnings

This commit is contained in:
Dmitriy Pleshevskiy 2021-02-21 17:53:43 +03:00
parent 4ed8861279
commit 7d631b1d24
3 changed files with 4 additions and 4 deletions

View file

@ -26,7 +26,7 @@ pub(crate) fn print_migration_lists(config: Config) -> StdResult<()> {
Vec::new() Vec::new()
} }
Err(e) => panic!(e), Err(e) => panic!("{}", e),
}; };
println!(); println!();

View file

@ -139,7 +139,7 @@ impl Config {
let migrations = entries let migrations = entries
.iter() .iter()
.filter_map(Migration::new) .filter_map(|path| Migration::new(&path))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
Ok(migrations) Ok(migrations)

View file

@ -5,7 +5,7 @@ use crate::path::PathBuilder;
use crate::StdResult; use crate::StdResult;
use std::convert::TryFrom; use std::convert::TryFrom;
use std::fs; use std::fs;
use std::path::PathBuf; use std::path::{Path, PathBuf};
#[derive(Debug)] #[derive(Debug)]
pub struct Migration { pub struct Migration {
@ -15,7 +15,7 @@ pub struct Migration {
} }
impl Migration { impl Migration {
pub(crate) fn new(directory: &PathBuf) -> Option<Migration> { pub(crate) fn new(directory: &Path) -> Option<Migration> {
if directory.is_dir() { if directory.is_dir() {
let name = directory let name = directory
.file_name() .file_name()