diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/dotnet.rs | 4 | ||||
-rw-r--r-- | src/modules/rust.rs | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/dotnet.rs b/src/modules/dotnet.rs index 738e38a93..5ca4d636f 100644 --- a/src/modules/dotnet.rs +++ b/src/modules/dotnet.rs @@ -165,8 +165,8 @@ fn get_pinned_sdk_version(json: &str) -> Option<Version> { fn get_local_dotnet_files<'a>(context: &'a Context) -> Result<Vec<DotNetFile<'a>>, std::io::Error> { Ok(context - .get_dir_files()? - .iter() + .dir_contents()? + .files() .filter_map(|p| { get_dotnet_file_type(p).map(|t| DotNetFile { path: p.as_ref(), diff --git a/src/modules/rust.rs b/src/modules/rust.rs index b18692b82..e11fa4301 100644 --- a/src/modules/rust.rs +++ b/src/modules/rust.rs @@ -1,4 +1,3 @@ -use std::ffi::OsStr; use std::path::Path; use std::process::{Command, Output}; use std::{env, fs}; @@ -107,13 +106,11 @@ fn find_rust_toolchain_file(context: &Context) -> Option<String> { Some(line.trim().to_owned()) } - if let Some(path) = context - .get_dir_files() - .ok()? - .iter() - .find(|p| p.file_name() == Some(OsStr::new("rust-toolchain"))) + if let Ok(true) = context + .dir_contents() + .map(|dir| dir.has_file("rust-toolchain")) { - if let Some(toolchain) = read_first_line(path) { + if let Some(toolchain) = read_first_line(Path::new("rust-toolchain")) { return Some(toolchain); } } |