From 78ea79b1bfc8d759d7f54fdd4c84e9aa636f58ca Mon Sep 17 00:00:00 2001 From: Manuel Fuchs Date: Wed, 10 Apr 2024 14:46:50 +0200 Subject: [PATCH] Rename execute to handle --- libcnb/src/build.rs | 6 +++--- libcnb/src/layer/struct_api/{execute.rs => handling.rs} | 4 ++-- libcnb/src/layer/struct_api/mod.rs | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) rename libcnb/src/layer/struct_api/{execute.rs => handling.rs} (98%) diff --git a/libcnb/src/build.rs b/libcnb/src/build.rs index 93101739..18316983 100644 --- a/libcnb/src/build.rs +++ b/libcnb/src/build.rs @@ -6,7 +6,7 @@ use crate::data::store::Store; use crate::data::{ buildpack::ComponentBuildpackDescriptor, buildpack_plan::BuildpackPlan, launch::Launch, }; -use crate::layer::handling::LayerErrorOrBuildpackError; +use crate::layer::trait_api::handling::LayerErrorOrBuildpackError; use crate::layer::{ CachedLayerDefinition, InspectExistingAction, IntoAction, InvalidMetadataAction, LayerRef, UncachedLayerDefinition, @@ -126,7 +126,7 @@ impl BuildContext { ) -> crate::Result, B::Error> { let layer_definition = layer_definition.borrow(); - crate::layer::execute( + crate::layer::struct_api::handling::handle_layer( LayerTypes { launch: layer_definition.launch, build: layer_definition.build, @@ -151,7 +151,7 @@ impl BuildContext { { let layer_definition = layer_definition.borrow(); - crate::layer::execute( + crate::layer::struct_api::handling::handle_layer( LayerTypes { launch: layer_definition.launch, build: layer_definition.build, diff --git a/libcnb/src/layer/struct_api/execute.rs b/libcnb/src/layer/struct_api/handling.rs similarity index 98% rename from libcnb/src/layer/struct_api/execute.rs rename to libcnb/src/layer/struct_api/handling.rs index e1a054f4..f8e00c53 100644 --- a/libcnb/src/layer/struct_api/execute.rs +++ b/libcnb/src/layer/struct_api/handling.rs @@ -16,7 +16,7 @@ use serde::Serialize; use std::marker::PhantomData; use std::path::{Path, PathBuf}; -pub(crate) fn execute( +pub(crate) fn handle_layer( layer_types: LayerTypes, invalid_metadata: &dyn Fn(&GenericMetadata) -> MA, inspect_existing: &dyn Fn(&M, &Path) -> IA, @@ -90,7 +90,7 @@ where LayerError::WriteLayerError(WriteLayerError::WriteLayerMetadataError(error)) })?; - execute( + handle_layer( layer_types, invalid_metadata, inspect_existing, diff --git a/libcnb/src/layer/struct_api/mod.rs b/libcnb/src/layer/struct_api/mod.rs index 645a6966..faf42354 100644 --- a/libcnb/src/layer/struct_api/mod.rs +++ b/libcnb/src/layer/struct_api/mod.rs @@ -1,11 +1,10 @@ -pub(crate) mod execute; +pub(crate) mod handling; use crate::layer::shared::{replace_layer_exec_d_programs, replace_layer_sboms, WriteLayerError}; use crate::layer::LayerError; use crate::layer_env::LayerEnv; use crate::sbom::Sbom; use crate::Buildpack; -pub(crate) use execute::execute; use libcnb_data::generic::GenericMetadata; use libcnb_data::layer::LayerName; use serde::Serialize;