add sort
This commit is contained in:
parent
c06399dc6d
commit
117650f757
@ -49,6 +49,10 @@ impl Source {
|
|||||||
let mut rng = thread_rng();
|
let mut rng = thread_rng();
|
||||||
self.files.shuffle(&mut rng);
|
self.files.shuffle(&mut rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn sort(&mut self) {
|
||||||
|
self.files.sort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn file_extension(filename: &Path) -> Option<&str> {
|
fn file_extension(filename: &Path) -> Option<&str> {
|
||||||
@ -95,6 +99,8 @@ pub fn walk(path: &String, shuffle: bool, extensions: &Vec<String>) {
|
|||||||
if shuffle {
|
if shuffle {
|
||||||
println!("Shuffle files in folder");
|
println!("Shuffle files in folder");
|
||||||
source.shuffle();
|
source.shuffle();
|
||||||
|
} else {
|
||||||
|
source.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
while index < source.files.len() {
|
while index < source.files.len() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user