mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add debug segment percentage (#93)
* Fix file extension unwrap panic * Change log output name from crunchy_cli_core to crunchy_cli * Add percentage output
This commit is contained in:
parent
9e0edda7c2
commit
03db38b31c
3 changed files with 11 additions and 6 deletions
|
|
@ -46,8 +46,8 @@ pub fn free_file(mut path: PathBuf) -> PathBuf {
|
|||
while path.exists() {
|
||||
i += 1;
|
||||
|
||||
let ext = path.extension().unwrap().to_string_lossy();
|
||||
let mut filename = path.file_stem().unwrap().to_str().unwrap();
|
||||
let ext = path.extension().unwrap_or_default().to_string_lossy();
|
||||
let mut filename = path.file_stem().unwrap_or_default().to_str().unwrap();
|
||||
|
||||
if filename.ends_with(&format!(" ({})", i - 1)) {
|
||||
filename = filename.strip_suffix(&format!(" ({})", i - 1)).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue