Skip to content

Commit f49ed96

Browse files
committed
Propagate 'public' field on dependencies to the index
This implements the crates.io side of rust-lang/rust#44663 This is fully backwards-compatible - 'public' will default to 'false' for old versions of Cargo that don't include it in their manifest
1 parent 91e03d3 commit f49ed96

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/git.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub struct Dependency {
3737
pub kind: Option<DependencyKind>,
3838
#[serde(skip_serializing_if = "Option::is_none")]
3939
pub package: Option<String>,
40+
pub public: bool
4041
}
4142

4243
pub struct Repository {

src/models/dependency.rs

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ pub fn add_dependencies(
119119
target: dep.target.clone(),
120120
kind: dep.kind.or(Some(DependencyKind::Normal)),
121121
package,
122+
public: dep.public.unwrap_or(false)
122123
},
123124
(
124125
version_id.eq(target_version_id),

src/views/krate_publish.rs

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub struct EncodableCrateDependency {
6464
pub kind: Option<DependencyKind>,
6565
pub explicit_name_in_toml: Option<EncodableCrateName>,
6666
pub registry: Option<String>,
67+
pub public: Option<bool>
6768
}
6869

6970
impl<'de> Deserialize<'de> for EncodableCrateName {

0 commit comments

Comments
 (0)