feat: recurse deeper in applications folder

max recursion 2 levels
This commit is contained in:
Cyril Levis
2021-12-30 22:04:19 +01:00
committed by Kenny Levinsen
parent 1edefd9cad
commit d4f62da6f5
3 changed files with 33 additions and 2 deletions
Generated
+30
View File
@@ -520,6 +520,15 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.123" version = "1.0.123"
@@ -663,6 +672,17 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
[[package]]
name = "walkdir"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
"same-file",
"winapi",
"winapi-util",
]
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.10.0+wasi-snapshot-preview1" version = "0.10.0+wasi-snapshot-preview1"
@@ -744,6 +764,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "winapi-x86_64-pc-windows-gnu" name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
@@ -776,6 +805,7 @@ dependencies = [
"shlex", "shlex",
"timerfd", "timerfd",
"unicode-segmentation", "unicode-segmentation",
"walkdir",
"wayland-client", "wayland-client",
"wayland-protocols", "wayland-protocols",
] ]
+1
View File
@@ -37,6 +37,7 @@ rcalc_lib = "0.9"
rust-ini = "0.14" rust-ini = "0.14"
shlex = "0.1" shlex = "0.1"
timerfd = "1.0.0" timerfd = "1.0.0"
walkdir = "2.3.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true }
+2 -2
View File
@@ -3,9 +3,9 @@ use ini::{Ini, ParseOption};
use std::cmp::Ordering; use std::cmp::Ordering;
use std::env; use std::env;
use std::error::Error; use std::error::Error;
use std::fs;
use std::io::Error as io_error; use std::io::Error as io_error;
use std::io::ErrorKind; use std::io::ErrorKind;
use walkdir::WalkDir;
#[derive(Clone, Debug, Eq, Hash)] #[derive(Clone, Debug, Eq, Hash)]
pub struct Desktop { pub struct Desktop {
@@ -56,7 +56,7 @@ impl Desktop {
fn parse_dir(d: &str) -> Result<Vec<Desktop>, Box<dyn Error>> { fn parse_dir(d: &str) -> Result<Vec<Desktop>, Box<dyn Error>> {
let mut files: Vec<Desktop> = Vec::with_capacity(16); let mut files: Vec<Desktop> = Vec::with_capacity(16);
for entry in fs::read_dir(d)? { for entry in WalkDir::new(d) {
let entry = entry?; let entry = entry?;
let path = entry.path(); let path = entry.path();