Skip to content

Commit 4204a38

Browse files
committed
build: change clipy configuration to support workspace and features
- avoid clippy genarte wrong warning about useless stuff - apply some clippy recommandation Signed-off-by: David Bernard <david.bernard.31@gmail.com>
1 parent 9b0d955 commit 4204a38

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ lint_cargo_deny:
3737
--config=tools/cargo-deny/deny.toml
3838

3939
lint_cargo_clippy:
40-
cargo clippy --no-deps --all-targets -- -D warnings
40+
cargo clippy --workspace --all-features --no-deps --all-targets -- --deny warnings
4141

4242
lint_cargo_toml_fmt_files:
4343
dprint fmt --config=tools/dprint/dprint.json

cdevents-sdk/src/id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct NonEmptyString(String);
1111

1212
impl NonEmptyString {
1313
pub fn as_str(&self) -> &str {
14-
&self.0.as_str()
14+
self.0.as_str()
1515
}
1616
}
1717

cdevents-sdk/src/uri_reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<> proptest::arbitrary::Arbitrary for UriReference {
7676
use proptest::prelude::*;
7777
(prop_oneof![
7878
"\\/[a-z_\\-\\/]+".prop_map(|s| UriReference::from_str(&s).unwrap()),
79-
Just("https://example.com/").prop_map(|s| UriReference::from_str(&s).unwrap()),
79+
Just("https://example.com/").prop_map(|s| UriReference::from_str(s).unwrap()),
8080
]).boxed()
8181
}
8282
}

cdevents-sdk/tests/specs.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ fn check_against_schema(json: &serde_json::Value, ty: &str) {
3838
let mut compiler = Compiler::new();
3939
let sch_index = compiler.compile(&schemapath, &mut schemas);
4040
if let Err(err) = sch_index {
41-
assert!(false, "{err:#}");
42-
return; // to allow sch_index.unwrap()
41+
panic!("{err:#}"); //like a assert(false,...)
4342
}
4443
let sch_index = sch_index.unwrap();
45-
let result = schemas.validate(&json, sch_index);
44+
let result = schemas.validate(json, sch_index);
4645
if let Err(err) = result {
47-
assert!(false, "{err}");
48-
return;
46+
panic!("{err}");
4947
}
5048
}
5149

0 commit comments

Comments
 (0)