mismatch amount error

This commit is contained in:
TD-Sky 2025-05-01 14:57:02 +08:00
parent f46cd3f8ee
commit 6a70ea3c57

View file

@ -52,13 +52,15 @@ impl Mgr {
}
async fn bulk_rename_do(root: PathBuf, old: Vec<PathBuf>, new: Vec<PathBuf>) -> Result<()> {
terminal_clear(TTY.writer())?;
if old.len() != new.len() {
#[rustfmt::skip]
let s = format!("Number of new and old file names mismatch (New: {}, Old: {}).\nPress <Enter> to exit...", new.len(), old.len());
execute!(TTY.writer(), Print(s))?;
TTY.reader().read_exact(&mut [0])?;
AppProxy::notify_error(
"Bulk rename",
format!(
"Number of new and old file names mismatch (New: {}, Old: {})",
new.len(),
old.len()
),
);
return Ok(());
}