-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 {
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,
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![],
};