tidying
This commit is contained in:
parent
3350b4fa69
commit
660a9bf7ad
@ -13,7 +13,7 @@ use std::borrow::Cow;
|
|||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct MediaCheckOutput {
|
pub struct MediaCheckOutput {
|
||||||
all_files: Vec<String>,
|
files: Vec<String>,
|
||||||
renamed: Vec<RenamedFile>,
|
renamed: Vec<RenamedFile>,
|
||||||
dirs: Vec<String>,
|
dirs: Vec<String>,
|
||||||
oversize: Vec<String>,
|
oversize: Vec<String>,
|
||||||
@ -51,11 +51,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn check(&mut self) -> Result<MediaCheckOutput> {
|
pub fn check(&mut self) -> Result<MediaCheckOutput> {
|
||||||
// rename any invalid files, by copying+trashing original
|
|
||||||
// note the rename in the list
|
|
||||||
// record current name regardless of rename
|
|
||||||
// note dirs/oversized files
|
|
||||||
|
|
||||||
// loop through on-disk files
|
// loop through on-disk files
|
||||||
let mut dirs = vec![];
|
let mut dirs = vec![];
|
||||||
let mut oversize = vec![];
|
let mut oversize = vec![];
|
||||||
@ -106,7 +101,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ok(MediaCheckOutput {
|
Ok(MediaCheckOutput {
|
||||||
all_files,
|
files: all_files,
|
||||||
renamed: renamed_files,
|
renamed: renamed_files,
|
||||||
dirs,
|
dirs,
|
||||||
oversize,
|
oversize,
|
||||||
@ -194,7 +189,7 @@ mod test {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
output,
|
output,
|
||||||
MediaCheckOutput {
|
MediaCheckOutput {
|
||||||
all_files: vec!["con_.jpg".to_string(), "normal.jpg".to_string()],
|
files: vec!["con_.jpg".to_string(), "normal.jpg".to_string()],
|
||||||
renamed: vec![RenamedFile {
|
renamed: vec![RenamedFile {
|
||||||
current_fname: "con_.jpg".to_string(),
|
current_fname: "con_.jpg".to_string(),
|
||||||
original_fname: "con.jpg".to_string()
|
original_fname: "con.jpg".to_string()
|
||||||
@ -226,7 +221,7 @@ mod test {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
output,
|
output,
|
||||||
MediaCheckOutput {
|
MediaCheckOutput {
|
||||||
all_files: vec!["ぱぱ.jpg".to_string()],
|
files: vec!["ぱぱ.jpg".to_string()],
|
||||||
renamed: vec![],
|
renamed: vec![],
|
||||||
dirs: vec![],
|
dirs: vec![],
|
||||||
oversize: vec![]
|
oversize: vec![]
|
||||||
@ -238,7 +233,7 @@ mod test {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
output,
|
output,
|
||||||
MediaCheckOutput {
|
MediaCheckOutput {
|
||||||
all_files: vec!["ぱぱ.jpg".to_string()],
|
files: vec!["ぱぱ.jpg".to_string()],
|
||||||
renamed: vec![RenamedFile {
|
renamed: vec![RenamedFile {
|
||||||
current_fname: "ぱぱ.jpg".to_string(),
|
current_fname: "ぱぱ.jpg".to_string(),
|
||||||
original_fname: "ぱぱ.jpg".to_string()
|
original_fname: "ぱぱ.jpg".to_string()
|
||||||
|
Loading…
Reference in New Issue
Block a user