Skip to content

Commit

Permalink
Expose the "build" function to let projects with submodules control w…
Browse files Browse the repository at this point in the history
…here to find the proper path.
  • Loading branch information
MichaelScofield committed Aug 2, 2024
1 parent ee12741 commit 1521a28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ impl Shadow {
pub fn build(deny_const: BTreeSet<ShadowConst>) -> SdResult<Shadow> {
let src_path = std::env::var("CARGO_MANIFEST_DIR")?;
let out_path = std::env::var("OUT_DIR")?;
Self::build_inner(src_path, out_path, deny_const)
Self::build_with(src_path, out_path, deny_const)
}

fn build_inner(
pub fn build_with(
src_path: String,
out_path: String,
deny_const: BTreeSet<ShadowConst>,
Expand Down Expand Up @@ -552,7 +552,7 @@ mod tests {

#[test]
fn test_build() -> SdResult<()> {
Shadow::build_inner("./".into(), "./".into(), Default::default())?;
Shadow::build_with("./".into(), "./".into(), Default::default())?;
let shadow = fs::read_to_string("./shadow.rs")?;
assert!(!shadow.is_empty());
assert!(shadow.lines().count() > 0);
Expand All @@ -563,7 +563,7 @@ mod tests {
fn test_build_deny() -> SdResult<()> {
let mut deny = BTreeSet::new();
deny.insert(CARGO_TREE);
Shadow::build_inner("./".into(), "./".into(), deny)?;
Shadow::build_with("./".into(), "./".into(), deny)?;
let shadow = fs::read_to_string("./shadow.rs")?;
assert!(!shadow.is_empty());
assert!(shadow.lines().count() > 0);
Expand Down

0 comments on commit 1521a28

Please sign in to comment.