Skip to content

Commit

Permalink
Remove semver and sha2 re-exports
Browse files Browse the repository at this point in the history
These re-exports appear to be unnecessary, and doesn't have any impact on code that rely on the `inventory` module (and uses these feature- trait implementation). Also see related prior discussion here Malax/inventory#2 (comment).

The `semver` and `sha2` modules only contain implementations of public traits, so I don't think we need to re-export those (unlike bringing for instance a function or struct in to scope).

If I understand how trait implementations work correctly, it doesn't matter where an implementation lives (only the visibility of the trait and the type it's implemented for is relevant) - in other words, the implementation will be available to any code that can access both the trait and the type, even across crate binaries.
  • Loading branch information
runesoerensen committed Sep 24, 2024
1 parent 99d7d3a commit e41dc7a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions libherokubuildpack/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ mod semver;
mod sha2;
mod unit;

#[allow(unused_imports, unreachable_pub)]
#[cfg(feature = "semver")]
pub use semver::*;
#[allow(unused_imports, unreachable_pub)]
#[cfg(feature = "sha2")]
pub use sha2::*;

use crate::inventory::artifact::{Arch, Artifact, Os};
use crate::inventory::checksum::Digest;
use crate::inventory::version::ArtifactRequirement;
Expand Down

0 comments on commit e41dc7a

Please sign in to comment.