Created
September 3, 2019 15:17
-
-
Save dreamer/a951e89907e85f3c37d57cd188787ce9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let json_files = fs::read_dir("metadata.lux")? | |
.take_while(|e| e.is_ok()) | |
.map(|e| e.unwrap().path()) | |
.take_while(|p| true); | |
//.take_while(|p| p.extension().unwrap() == "json"); | |
for p in json_files { | |
println!(":: {:?} {} {:?} {:?}", p, p.ends_with("json"), p.extension().unwrap(), p.extension().unwrap() == "json"); | |
} | |
// prints: | |
:: "metadata.lux/vkquake.files" false "files" false | |
:: "metadata.lux/vkquake.json" false "json" true | |
let json_files = fs::read_dir("metadata.lux")? | |
.take_while(|e| e.is_ok()) | |
.map(|e| e.unwrap().path()) | |
.take_while(|p| p.extension().unwrap() == "json"); | |
//.take_while(|p| true); | |
for p in json_files { | |
println!(":: {:?} {} {:?} {:?}", p, p.ends_with("json"), p.extension().unwrap(), p.extension().unwrap() == "json"); | |
} | |
// prints nothig! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment