Updated api bootstrap
This commit is contained in:
@@ -10,9 +10,9 @@ pub class Module {
|
||||
pub Vec<Self> children;
|
||||
|
||||
pub constructor(PathBuf mist_path) {
|
||||
self.children = new Vec();
|
||||
self.children = Vec::new();
|
||||
self.name = mist_path.file_stem()
|
||||
.and_then(|var s| s.to_str())
|
||||
.and_then(|let s| s.to_str())
|
||||
.expect("Failed to get module name")
|
||||
.to_string();
|
||||
self.path = mist_path;
|
||||
@@ -30,7 +30,7 @@ pub class Module {
|
||||
}
|
||||
|
||||
void scan_directory(self mut*, Path* search_dir) {
|
||||
var entries = match (fs::read_dir(search_dir)) {
|
||||
let entries = match (fs::read_dir(search_dir)) {
|
||||
Ok[entries] => entries;
|
||||
Err[e] => {
|
||||
eprintln!("error: failed to read directory {}\n {}", search_dir.display(), e);
|
||||
@@ -39,7 +39,7 @@ pub class Module {
|
||||
};
|
||||
|
||||
for (entry : entries) {
|
||||
var entry = match (entry) {
|
||||
let entry = match (entry) {
|
||||
Ok[entry] => entry;
|
||||
Err[e] => {
|
||||
eprintln!("error: failed to read directory entry\n {}", e);
|
||||
@@ -53,7 +53,7 @@ pub class Module {
|
||||
continue;
|
||||
}
|
||||
|
||||
self.children.push(new Module(child_path));
|
||||
self.children.push(Module::new(child_path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ pub class Module {
|
||||
}
|
||||
|
||||
pub Module master_package(PathBuf mist_path) {
|
||||
var mut root_mod = new Module(mist_path.clone());
|
||||
let mut root_mod = Module::new(mist_path.clone());
|
||||
|
||||
Path* parent_dir = mist_path.parent()
|
||||
.expect("Failed to get parent directory of root file");
|
||||
|
||||
Reference in New Issue
Block a user