MUSIC PLAYERgit diff --cached src/window_likes/malvim.rs! and fixes
This commit is contained in:
14
src/fs.rs
14
src/fs.rs
@@ -1,4 +1,5 @@
|
||||
use std::fs::read_dir;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use bmp_rust::bmp::BMP;
|
||||
|
||||
@@ -49,3 +50,16 @@ pub fn get_bmp(path: &str) -> Vec<Vec<Vec<u8>>> {
|
||||
bmp
|
||||
}
|
||||
|
||||
pub fn get_all_files(dir: PathBuf) -> Vec<PathBuf> {
|
||||
let mut files = Vec::new();
|
||||
for entry in read_dir(dir).unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
if path.is_dir() {
|
||||
files.extend(get_all_files(path));
|
||||
} else {
|
||||
files.push(path);
|
||||
}
|
||||
}
|
||||
files
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user