From 94a9bd5f5dc0cfb6319f7475c1d9296b7a0a1b2a Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 14 Jun 2018 18:25:04 +0200 Subject: [PATCH] Fix regression due to pending stabilization of Iterator::flatten --- src/main.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 94ef1fa..5ab44ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,14 +76,13 @@ fn main() { let mut registered_languages_vec: Vec> = vec![Box::new(SimpleLinewise), Box::new(SimpleCharwise)]; let raw_language_plugin_path = env::var_os("DENG_RAW_LANGUAGE_PLUGIN_PATH"); - for plugin in env::current_dir() - .into_iter() - .map(|d| d.join(".deng").join("languages").join("raw")) - .chain(raw_language_plugin_path.as_ref().into_iter().flat_map(env::split_paths)) - .chain(env::home_dir().into_iter().map(|d| d.join(".deng").join("languages").join("raw"))) - .flat_map(|d| d.read_dir().into_iter()) - .flatten() - .flatten() + for plugin in Itertools::flatten(Itertools::flatten(env::current_dir() + .into_iter() + .map(|d| d.join(".deng").join("languages").join("raw")) + .chain(raw_language_plugin_path.as_ref().into_iter().flat_map(env::split_paths)) + .chain(env::home_dir().into_iter().map(|d| d.join(".deng").join("languages").join("raw"))) + .flat_map(|d| d.read_dir().into_iter()) + )) .map(|e| e.path()) .filter(|p| { p.file_stem().and_then(|s| s.to_str()).map(|s| s.starts_with(DLL_PREFIX)) == Some(true) &&