Skip to content

Commit

Permalink
fix cargo clippy check
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Dec 15, 2024
1 parent 8cb7c4b commit 07150f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gen_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const CLAP_LONG_VERSION_TAG_CONST: (&str, &str) = (
tag:{}
commit_hash:{}
build_time:{}
build_env:{},{}"#,PKG_VERSION, TAG, SHORT_COMMIT, BUILD_TIME_2822, RUST_VERSION, RUST_CHANNEL
build_env:{},{}"#,PKG_VERSION, TAG, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, RUST_CHANNEL
);"##,
);

Expand Down
16 changes: 11 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,10 @@ mod tests {

#[test]
fn test_build() -> SdResult<()> {
Shadow::build_with("./".into(), "./".into(), Default::default())?;
ShadowBuilder::builder()
.src_path("./")
.out_path("./")
.build()?;
let shadow = fs::read_to_string("./shadow.rs")?;
assert!(!shadow.is_empty());
assert!(shadow.lines().count() > 0);
Expand All @@ -695,13 +698,16 @@ mod tests {

#[test]
fn test_build_deny() -> SdResult<()> {
let mut deny = BTreeSet::new();
deny.insert(CARGO_TREE);
Shadow::build_with("./".into(), "./".into(), deny)?;
ShadowBuilder::builder()
.src_path("./")
.out_path("./")
.deny_const(BTreeSet::from([CARGO_TREE]))
.build()?;

let shadow = fs::read_to_string("./shadow.rs")?;
assert!(!shadow.is_empty());
assert!(shadow.lines().count() > 0);
println!("{shadow}");
// println!("{shadow}");
let expect = "pub const CARGO_TREE :&str";
assert!(!shadow.contains(expect));
Ok(())
Expand Down

0 comments on commit 07150f0

Please sign in to comment.