Skip to content

Commit

Permalink
Fewer deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Sep 21, 2024
1 parent 0b32324 commit a0f781b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
8 changes: 1 addition & 7 deletions buildpacks/ruby/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ impl Buildpack for RubyBuildpack {
}

#[allow(clippy::too_many_lines)]
#[allow(deprecated)]
fn build(&self, context: BuildContext<Self>) -> libcnb::Result<BuildResult, Self::Error> {
let mut logger = BuildLog::new(stdout()).buildpack_name("Heroku Ruby Buildpack");
let warn_later = WarnGuard::new(stdout());
Expand Down Expand Up @@ -154,7 +155,6 @@ impl Buildpack for RubyBuildpack {
fmt::value(ruby_version.to_string()),
fmt::value(gemfile_lock.ruby_source())
));
#[allow(deprecated)]
let ruby_layer = context //
.handle_layer(
layer_name!("ruby"),
Expand All @@ -168,7 +168,6 @@ impl Buildpack for RubyBuildpack {
},
},
)?;
#[allow(deprecated)]
let env = ruby_layer.env.apply(Scope::Build, &env);
(section.end_section(), env)
};
Expand All @@ -180,7 +179,6 @@ impl Buildpack for RubyBuildpack {
fmt::value(bundler_version.to_string()),
fmt::value(gemfile_lock.bundler_source())
));
#[allow(deprecated)]
let download_bundler_layer = context.handle_layer(
layer_name!("bundler"),
BundleDownloadLayer {
Expand All @@ -191,8 +189,6 @@ impl Buildpack for RubyBuildpack {
_section_logger: section.as_ref(),
},
)?;

#[allow(deprecated)]
let env = download_bundler_layer.env.apply(Scope::Build, &env);

(section.end_section(), env)
Expand All @@ -201,7 +197,6 @@ impl Buildpack for RubyBuildpack {
// ## Bundle install
(logger, env) = {
let section = logger.section("Bundle install");
#[allow(deprecated)]
let bundle_install_layer = context.handle_layer(
layer_name!("gems"),
BundleInstallLayer {
Expand Down Expand Up @@ -231,7 +226,6 @@ impl Buildpack for RubyBuildpack {
},
},
)?;
#[allow(deprecated)]
let env = bundle_install_layer.env.apply(Scope::Build, &env);
(section.end_section(), env)
};
Expand Down
3 changes: 1 addition & 2 deletions commons/src/cache/app_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ pub enum PathState {
/// # Errors
///
/// - If the layer cannot be created
#[allow(deprecated)]
pub fn build<B: libcnb::Buildpack>(
context: &BuildContext<B>,
config: CacheConfig,
Expand All @@ -249,12 +250,10 @@ pub fn build<B: libcnb::Buildpack>(
let layer_name = create_layer_name(&context.app_dir, &path)?;
let create_state = layer_name_cache_state(&context.layers_dir, &layer_name);

#[allow(deprecated)]
let layer = context
.handle_layer(layer_name, InAppDirCacheLayer::new(path.clone()))
.map_err(|error| CacheError::InternalLayerError(format!("{error:?}")))?;

#[allow(deprecated)]
let cache = layer.path;

Ok(AppCache {
Expand Down
2 changes: 0 additions & 2 deletions commons/src/cache/in_app_dir_cache_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ where
}
}

#[allow(deprecated)]
fn create(
&mut self,
_context: &BuildContext<Self::Buildpack>,
Expand All @@ -70,7 +69,6 @@ where
.build()
}

#[allow(deprecated)]
fn existing_layer_strategy(
&mut self,
_context: &BuildContext<Self::Buildpack>,
Expand Down

0 comments on commit a0f781b

Please sign in to comment.