Skip to content

Commit

Permalink
chore: ensure that generic type implements Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
raimundo-henriques committed Oct 4, 2024
1 parent c329675 commit d9edd03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use uuid::Uuid;
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, PartialEq)]
#[serde(rename_all = "camelCase")]
/// Data Type "ProductFootprint" of Tech Spec Version 2
pub struct ProductFootprint<T: JsonSchema> {
pub struct ProductFootprint<T: JsonSchema + Clone> {
pub id: PfId,
pub spec_version: SpecVersionString,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -448,7 +448,7 @@ pub enum AssuranceBoundary {

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct DataModelExtension<T: JsonSchema> {
pub struct DataModelExtension<T: JsonSchema + Clone> {
pub spec_version: SpecVersionString,
pub data_schema: String, // Replace String with URL
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -890,7 +890,7 @@ impl JsonSchema for PfId {
}
}

impl<T: JsonSchema> JsonSchema for DataModelExtension<T> {
impl<T: JsonSchema + Clone> JsonSchema for DataModelExtension<T> {
fn schema_name() -> String {
"DataModelExtension".into()
}
Expand Down

0 comments on commit d9edd03

Please sign in to comment.