From c7b2b6a60c9a621bef9dfe7083da7cfb7fa00fff Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Fri, 22 Sep 2023 02:34:35 -0500 Subject: [PATCH] Derive Copy and Clone for LayerTypes (#670) I want to be able to inject `LayerType` into a struct instead of needing to hard code it. Currently this can be done but isn't ergonomic because `LayerTypes` is not clone. Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com> --- CHANGELOG.md | 2 ++ libcnb-data/src/layer_content_metadata.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 118349c2..294ebf5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `libcnb`: + - `LayerTypes` now implements `Copy` and `Clone`. ([#670](https://github.com/heroku/libcnb.rs/pull/670)). - `libcnb-data`: - `ExecDProgramOutputKey`, `ProcessType`, `LayerName`, `BuildpackId` and `StackId` now implement `Ord` and `PartialOrd`. ([#658](https://github.com/heroku/libcnb.rs/pull/658)) - Added `generic::GenericMetadata` as a generic metadata type. Also makes it the default for `BuildpackDescriptor`, `SingleBuildpackDescriptor`, `CompositeBuildpackDescriptor` and `LayerContentMetadata`. ([#664](https://github.com/heroku/libcnb.rs/pull/664)) diff --git a/libcnb-data/src/layer_content_metadata.rs b/libcnb-data/src/layer_content_metadata.rs index e5f8026b..dadec05b 100644 --- a/libcnb-data/src/layer_content_metadata.rs +++ b/libcnb-data/src/layer_content_metadata.rs @@ -21,7 +21,7 @@ impl PartialEq for LayerContentMetadata { /// Used to specify layer availability based /// on buildpack phase. -#[derive(Debug, Default, Deserialize, Serialize, Eq, PartialEq)] +#[derive(Debug, Default, Deserialize, Serialize, Eq, PartialEq, Copy, Clone)] #[serde(deny_unknown_fields)] pub struct LayerTypes { /// Whether the layer is intended for launch.