Skip to content

Commit

Permalink
build: change clipy configuration to support workspace and features
Browse files Browse the repository at this point in the history
- avoid clippy genarte wrong warning about useless stuff
- apply some clippy recommandation

Signed-off-by: David Bernard <david.bernard.31@gmail.com>
  • Loading branch information
davidB committed Jan 30, 2024
1 parent 97b6a51 commit 799cd26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ lint_cargo_deny:
--config=tools/cargo-deny/deny.toml

lint_cargo_clippy:
cargo clippy --no-deps --all-targets -- -D warnings
cargo clippy --workspace --all-features --no-deps --all-targets -- --deny warnings

lint_cargo_toml_fmt_files:
dprint fmt --config=tools/dprint/dprint.json
Expand Down
2 changes: 1 addition & 1 deletion cdevents-sdk/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct NonEmptyString(String);

impl NonEmptyString {
pub fn as_str(&self) -> &str {
&self.0.as_str()
self.0.as_str()
}
}

Expand Down
2 changes: 1 addition & 1 deletion cdevents-sdk/src/uri_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<> proptest::arbitrary::Arbitrary for UriReference {
use proptest::prelude::*;
(prop_oneof![
"\\/[a-z_\\-\\/]+".prop_map(|s| UriReference::from_str(&s).unwrap()),
Just("https://example.com/").prop_map(|s| UriReference::from_str(&s).unwrap()),
Just("https://example.com/").prop_map(|s| UriReference::from_str(s).unwrap()),
]).boxed()
}
}
Expand Down
8 changes: 3 additions & 5 deletions cdevents-sdk/tests/specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ fn check_against_schema(json: &serde_json::Value, ty: &str) {
let mut compiler = Compiler::new();
let sch_index = compiler.compile(&schemapath, &mut schemas);
if let Err(err) = sch_index {
assert!(false, "{err:#}");
return; // to allow sch_index.unwrap()
panic!("{err:#}"); //like a assert(false,...)
}
let sch_index = sch_index.unwrap();
let result = schemas.validate(&json, sch_index);
let result = schemas.validate(json, sch_index);
if let Err(err) = result {
assert!(false, "{err}");
return;
panic!("{err}");
}
}

Expand Down

0 comments on commit 799cd26

Please sign in to comment.