We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 777cb59 + fd709ef commit 936ce39Copy full SHA for 936ce39
rust/signed_doc/src/validator/rules/content_type.rs
@@ -83,7 +83,7 @@ impl ContentTypeRule {
83
);
84
return Ok(false);
85
};
86
- if !validate(exp, &content) {
+ if !validate(*exp, &content) {
87
doc.report().invalid_value(
88
"payload",
89
&hex::encode(content),
@@ -108,11 +108,7 @@ fn validate(
108
},
109
ContentType::Cbor => {
110
let mut decoder = minicbor::Decoder::new(content);
111
- if decoder.skip().is_ok() && decoder.position() == content.len() {
112
- true
113
- } else {
114
- false
115
- }
+ decoder.skip().is_ok() && decoder.position() == content.len()
116
117
ContentType::SchemaJson => {
118
let Ok(template_json_schema) = serde_json::from_slice(content) else {
0 commit comments