mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-08-31 20:45:34 +00:00
Fix of "thread 'main' panicked at 'range start index 130 out of range for slice of length 104', src/output.rs:21:9"
This commit is contained in:
@@ -17,10 +17,13 @@ fn format_path(path: &str, opts: &Params) -> Result<String> {
|
||||
let display_path = path.replace(&opts.get_directory()?, "");
|
||||
let text_vec = display_path.chars().collect::<Vec<_>>();
|
||||
|
||||
let display_range = if text_vec.len() > 32 {
|
||||
text_vec[(display_path.len() - 32)..]
|
||||
let display_range = if text_vec.len() < 32 {
|
||||
text_vec
|
||||
.iter()
|
||||
.collect::<String>()
|
||||
.rev()
|
||||
.take(32)
|
||||
.rev()
|
||||
.collect()
|
||||
} else {
|
||||
display_path
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user