Skip to content

Commit

Permalink
Add struct_api handling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax committed Jun 14, 2024
1 parent f980b63 commit 29c77ff
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 16 deletions.
8 changes: 4 additions & 4 deletions libcnb/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl<B: Buildpack + ?Sized> BuildContext<B> {
/// ```
pub fn cached_layer<'a, M, MA, EA, MAC, EAC>(
&self,
layer_name: LayerName,
layer_name: impl Borrow<LayerName>,
layer_definition: impl Borrow<CachedLayerDefinition<'a, M, MA, EA>>,
) -> crate::Result<LayerRef<B, MAC, EAC>, B::Error>
where
Expand All @@ -365,7 +365,7 @@ impl<B: Buildpack + ?Sized> BuildContext<B> {
},
layer_definition.invalid_metadata,
layer_definition.inspect_existing,
layer_name,
layer_name.borrow(),
&self.layers_dir,
)
}
Expand All @@ -378,7 +378,7 @@ impl<B: Buildpack + ?Sized> BuildContext<B> {
/// This function is essentially the same as [`BuildContext::uncached_layer`] but simpler.
pub fn uncached_layer(
&self,
layer_name: LayerName,
layer_name: impl Borrow<LayerName>,
layer_definition: impl Borrow<UncachedLayerDefinition>,
) -> crate::Result<LayerRef<B, (), ()>, B::Error> {
let layer_definition = layer_definition.borrow();
Expand All @@ -391,7 +391,7 @@ impl<B: Buildpack + ?Sized> BuildContext<B> {
},
&|_| InvalidMetadataAction::DeleteLayer,
&|_: &GenericMetadata, _| InspectExistingAction::DeleteLayer,
layer_name,
layer_name.borrow(),
&self.layers_dir,
)
}
Expand Down
Loading

0 comments on commit 29c77ff

Please sign in to comment.