-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::entry::{entry_defines, EntryDefine}; | ||
use std::path::PathBuf; | ||
|
||
pub fn find_entry_define(target_entry: &String, path: &PathBuf) -> EntryDefine { | ||
let entries: Vec<EntryDefine> = entry_defines::entries_define_from_path(path) | ||
.into_iter() | ||
.filter(|define| define.entry_type.eq(target_entry)) | ||
.collect(); | ||
|
||
let entries_define = if entries.len() == 0 { | ||
EntryDefine::default() | ||
} else { | ||
entries[0].clone() | ||
}; | ||
entries_define | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod entry_define_usecases; | ||
pub mod entry_usecases; | ||
pub mod entrysets; |