Remove schemars impl for test type

We do not test the schemars stuff in `hashes`, instead we do it in a
separate crate `extended_tests/schemars`. There is therefore no reason
to implement `schemars::JsonSchema` for the `TestHashTag`.
This commit is contained in:
Tobin C. Harding 2024-04-23 12:40:26 +10:00
parent 4a4e07d66a
commit 216422dffc
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 0 additions and 15 deletions

View File

@ -185,21 +185,6 @@ mod tests {
} }
} }
#[cfg(feature = "schemars")]
impl schemars::JsonSchema for TestHashTag {
fn schema_name() -> String { "Hash".to_owned() }
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
let mut schema: schemars::schema::SchemaObject = <String>::json_schema(gen).into();
schema.string = Some(Box::new(schemars::schema::StringValidation {
max_length: Some(64 * 2),
min_length: Some(64 * 2),
pattern: Some("[0-9a-fA-F]+".to_owned()),
}));
schema.into()
}
}
/// A hash tagged with `$name`. /// A hash tagged with `$name`.
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
pub type TestHash = sha256t::Hash<TestHashTag>; pub type TestHash = sha256t::Hash<TestHashTag>;