chore: cargo fmt

This commit is contained in:
Talison Fabio 2025-03-23 11:39:57 -03:00
parent f916f4d419
commit e2e28b008f
2 changed files with 3 additions and 6 deletions

View File

@ -22,7 +22,7 @@ pub fn is_path_stdin(path: &Path) -> bool {
/// Check if &Path exists, if it does then ask the user if they want to overwrite or rename it.
/// If the user want to overwrite then the file or directory will be removed and returned the same input path
/// If the user want to rename then nothing will be removed and a new path will be returned with a new name
///
///
/// * `Ok(None)` means the user wants to cancel the operation
/// * `Ok(Some(path))` returns a valid PathBuf without any another file or directory with the same name
/// * `Err(_)` is an error

View File

@ -45,7 +45,7 @@ pub enum FileConflitOperation {
Cancel,
/// Overwrite the existing file with the new one
Overwrite,
/// Rename the file
/// Rename the file
/// It'll be put "_1" at the end of the filename or "_2","_3","_4".. if already exists
Rename,
}
@ -223,10 +223,7 @@ impl<'a, T: Default> ChoicePrompt<'a, T> {
answer.make_ascii_lowercase();
let answer = answer.trim();
let chosen_index = self
.choises
.iter()
.position(|choise| choise.label.starts_with(answer));
let chosen_index = self.choises.iter().position(|choise| choise.label.starts_with(answer));
if let Some(i) = chosen_index {
return Ok(self.choises.remove(i).value);