Skip to content

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ rust-version = "1.74"
88
autotests = false
99

1010
[lints.rust]
11+
unreachable_pub = "warn"
12+
unsafe_code = "warn"
1113
unused_crate_dependencies = "warn"
1214

1315
[lints.clippy]
16+
panic_in_result_fn = "warn"
1417
pedantic = "warn"
18+
unwrap_used = "warn"
1519
# Prevent warnings caused by the large size of `ureq::Error` in error enums,
1620
# where it is not worth boxing since the enum size doesn't affect performance.
1721
large_enum_variant = "allow"

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allow-unwrap-in-tests = true

src/layers/pip_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use std::path::Path;
1313
/// Layer containing Pip's cache of HTTP requests/downloads and built package wheels.
1414
pub(crate) struct PipCacheLayer<'a> {
1515
/// The Python version used for this build.
16-
pub python_version: &'a PythonVersion,
16+
pub(crate) python_version: &'a PythonVersion,
1717
/// The pip, setuptools and wheel versions used for this build.
18-
pub packaging_tool_versions: &'a PackagingToolVersions,
18+
pub(crate) packaging_tool_versions: &'a PackagingToolVersions,
1919
}
2020

2121
impl Layer for PipCacheLayer<'_> {

src/layers/pip_dependencies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use std::{fs, io};
1414
/// Layer containing the application's Python dependencies, installed using Pip.
1515
pub(crate) struct PipDependenciesLayer<'a> {
1616
/// Environment variables inherited from earlier buildpack steps.
17-
pub command_env: &'a Env,
17+
pub(crate) command_env: &'a Env,
1818
/// The path to the Pip cache directory, which is stored in another layer since it isn't needed at runtime.
19-
pub pip_cache_dir: PathBuf,
19+
pub(crate) pip_cache_dir: PathBuf,
2020
}
2121

2222
impl Layer for PipDependenciesLayer<'_> {

src/layers/python.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ use std::{fs, io};
3232
/// - It matches what both local and official Docker image environments do.
3333
pub(crate) struct PythonLayer<'a> {
3434
/// Environment variables inherited from earlier buildpack steps.
35-
pub command_env: &'a Env,
35+
pub(crate) command_env: &'a Env,
3636
/// The Python version that this layer should install.
37-
pub python_version: &'a PythonVersion,
37+
pub(crate) python_version: &'a PythonVersion,
3838
/// The pip, setuptools and wheel versions that this layer should install.
39-
pub packaging_tool_versions: &'a PackagingToolVersions,
39+
pub(crate) packaging_tool_versions: &'a PackagingToolVersions,
4040
}
4141

4242
impl Layer for PythonLayer<'_> {

src/packaging_tool_versions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const WHEEL_REQUIREMENT: &str = include_str!("../requirements/wheel.txt");
1010
/// semver, and we never introspect the version parts anyway.
1111
#[derive(Clone, Deserialize, PartialEq, Serialize)]
1212
pub(crate) struct PackagingToolVersions {
13-
pub pip_version: String,
14-
pub setuptools_version: String,
15-
pub wheel_version: String,
13+
pub(crate) pip_version: String,
14+
pub(crate) setuptools_version: String,
15+
pub(crate) wheel_version: String,
1616
}
1717

1818
impl Default for PackagingToolVersions {

src/python_version.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ pub(crate) const DEFAULT_PYTHON_VERSION: PythonVersion = PythonVersion {
1515
/// Representation of a specific Python `X.Y.Z` version.
1616
#[derive(Clone, Debug, PartialEq)]
1717
pub(crate) struct PythonVersion {
18-
pub major: u16,
19-
pub minor: u16,
20-
pub patch: u16,
18+
pub(crate) major: u16,
19+
pub(crate) minor: u16,
20+
pub(crate) patch: u16,
2121
}
2222

2323
impl PythonVersion {
24-
pub fn new(major: u16, minor: u16, patch: u16) -> Self {
24+
pub(crate) fn new(major: u16, minor: u16, patch: u16) -> Self {
2525
Self {
2626
major,
2727
minor,
2828
patch,
2929
}
3030
}
3131

32-
pub fn url(&self, stack_id: &StackId) -> String {
32+
pub(crate) fn url(&self, stack_id: &StackId) -> String {
3333
// TODO: (W-11474658) Switch to tracking versions/URLs via a manifest file.
3434
format!(
3535
"https://heroku-buildpack-python.s3.us-east-1.amazonaws.com/{}/runtimes/python-{}.{}.{}.tar.gz",

src/runtime_txt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub(crate) enum RuntimeTxtError {
5959
/// Errors that can occur when parsing the contents of a `runtime.txt` file.
6060
#[derive(Debug, PartialEq)]
6161
pub(crate) struct ParseRuntimeTxtError {
62-
pub cleaned_contents: String,
62+
pub(crate) cleaned_contents: String,
6363
}
6464

6565
#[cfg(test)]

0 commit comments

Comments
 (0)