]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_session/search_paths.rs
Auto merge of #68298 - Mark-Simulacrum:binary-depdep-fix, r=petrochenkov
[rust.git] / src / librustc_session / search_paths.rs
index b9f2ae7618b91d93a0987e965d824def732a57e3..06f408b4a8d64f8def249268172040bd2565e087 100644 (file)
@@ -1,6 +1,6 @@
-use std::path::{Path, PathBuf};
-use crate::{early_error, config};
 use crate::filesearch::make_target_lib_path;
+use crate::{config, early_error};
+use std::path::{Path, PathBuf};
 
 #[derive(Clone, Debug)]
 pub struct SearchPath {
@@ -9,7 +9,7 @@ pub struct SearchPath {
     pub files: Vec<PathBuf>,
 }
 
-#[derive(PartialEq, Clone, Copy, Debug, Hash, Eq)]
+#[derive(PartialEq, Clone, Copy, Debug, Hash, Eq, RustcEncodable, RustcDecodable)]
 pub enum PathKind {
     Native,
     Crate,
@@ -60,12 +60,7 @@ pub fn from_sysroot_and_triple(sysroot: &Path, triple: &str) -> Self {
     fn new(kind: PathKind, dir: PathBuf) -> Self {
         // Get the files within the directory.
         let files = match std::fs::read_dir(&dir) {
-            Ok(files) => {
-                files.filter_map(|p| {
-                    p.ok().map(|s| s.path())
-                })
-                .collect::<Vec<_>>()
-            }
+            Ok(files) => files.filter_map(|p| p.ok().map(|s| s.path())).collect::<Vec<_>>(),
             Err(..) => vec![],
         };