Skip to content

Commit

Permalink
Derive Copy and Clone for LayerTypes (#670)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
schneems and edmorley authored Sep 22, 2023
1 parent 7f64bf2 commit c7b2b6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libcnb-data/src/layer_content_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<M: PartialEq> PartialEq for LayerContentMetadata<M> {

/// 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.
Expand Down

0 comments on commit c7b2b6a

Please sign in to comment.