Skip to content

Commit

Permalink
Merge pull request #174 from demurgos/feature/dependency-registry
Browse files Browse the repository at this point in the history
feature: expose dependency registry url
  • Loading branch information
Byron authored Jul 30, 2024
2 parents 9bfd7eb + 7042251 commit 8b0a542
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub struct Dependency {
package: Option<Box<SmolStr>>,
#[serde(skip_serializing_if = "Option::is_none")]
kind: Option<DependencyKind>,
registry: SmolStr,
#[serde(skip_serializing_if = "Option::is_none")]
target: Option<Box<SmolStr>>,
optional: bool,
Expand Down Expand Up @@ -196,6 +197,15 @@ impl Dependency {
self.kind.unwrap_or_default()
}

/// Registry URL
///
/// Example: `https://github.com/rust-lang/crates.io-index.git`
#[inline]
#[must_use]
pub fn registry(&self) -> &str {
&self.registry
}

/// Set if dependency's crate name is different from the `name` (alias)
#[inline]
#[must_use]
Expand Down

0 comments on commit 8b0a542

Please sign in to comment.