Skip to content

Commit

Permalink
Merge pull request #169 from MichaelScofield/flexible-for-submodule
Browse files Browse the repository at this point in the history
Find the right git info in a project with submodules
  • Loading branch information
baoyachi authored Aug 2, 2024
2 parents ee12741 + 1521a28 commit 458be25
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 458be25

Please sign in to comment.