clippy
This commit is contained in:
@ -117,25 +117,23 @@ fn find_cuda_home(perf_libs_path: &Path) -> Option<PathBuf> {
|
||||
}
|
||||
|
||||
// Search /usr/local for a `cuda-` directory that matches a perf-libs subdirectory
|
||||
for entry in fs::read_dir(&perf_libs_path).unwrap() {
|
||||
if let Ok(entry) = entry {
|
||||
let path = entry.path();
|
||||
if !path.is_dir() {
|
||||
continue;
|
||||
}
|
||||
let dir_name = path.file_name().unwrap().to_str().unwrap_or("");
|
||||
if !dir_name.starts_with("cuda-") {
|
||||
continue;
|
||||
}
|
||||
|
||||
let cuda_home: PathBuf = ["/", "usr", "local", dir_name].iter().collect();
|
||||
if !cuda_home.is_dir() {
|
||||
continue;
|
||||
}
|
||||
|
||||
info!("CUDA installation found at {:?}", cuda_home);
|
||||
return Some(cuda_home);
|
||||
for entry in fs::read_dir(&perf_libs_path).unwrap().flatten() {
|
||||
let path = entry.path();
|
||||
if !path.is_dir() {
|
||||
continue;
|
||||
}
|
||||
let dir_name = path.file_name().unwrap().to_str().unwrap_or("");
|
||||
if !dir_name.starts_with("cuda-") {
|
||||
continue;
|
||||
}
|
||||
|
||||
let cuda_home: PathBuf = ["/", "usr", "local", dir_name].iter().collect();
|
||||
if !cuda_home.is_dir() {
|
||||
continue;
|
||||
}
|
||||
|
||||
info!("CUDA installation found at {:?}", cuda_home);
|
||||
return Some(cuda_home);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
Reference in New Issue
Block a user