-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored and cleaned up some main driver code
- Loading branch information
1 parent
ff4f922
commit 5644a63
Showing
9 changed files
with
156 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use super::{ | ||
explore::{explore, ExploreResult}, | ||
fs::{Fs, FsNodeId}, | ||
module_file::ModuleFile, | ||
}; | ||
use std::path::{Path, PathBuf}; | ||
|
||
pub struct ExploreWithinResult { | ||
pub explored: Option<ExploreResult>, | ||
pub entry: Option<FsNodeId>, | ||
} | ||
|
||
pub fn explore_within( | ||
fs: &Fs, | ||
project_folder: &Path, | ||
single_file: Option<PathBuf>, | ||
) -> ExploreWithinResult { | ||
if let Some(single_file) = single_file { | ||
let fs_node_id = fs.insert(&single_file, None).expect("inserted"); | ||
|
||
ExploreWithinResult { | ||
explored: Some(ExploreResult { | ||
normal_files: vec![], | ||
module_files: vec![ModuleFile { | ||
path: single_file, | ||
fs_node_id, | ||
}], | ||
}), | ||
entry: Some(fs_node_id), | ||
} | ||
} else { | ||
ExploreWithinResult { | ||
explored: explore(fs, project_folder), | ||
entry: None, | ||
} | ||
} | ||
} |
Oops, something went wrong.