Skip to content

Commit b6ffa90

Browse files
committed
fix
1 parent ee68d58 commit b6ffa90

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/db/add_package.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ pub struct ReleaseId(pub i32);
3535
#[sqlx(transparent)]
3636
pub struct BuildId(pub i32);
3737

38-
type DepOut = (String, VersionReq, DependencyKind, bool);
39-
type DepIn = (String, VersionReq, Option<DependencyKind>, Option<bool>);
38+
type Dep = (String, VersionReq, Option<DependencyKind>, Option<bool>);
4039

4140
/// A crate dependency in our internal representation for releases.dependencies json.
4241
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Deref)]
43-
#[serde(from = "DepIn", into = "DepOut")]
42+
#[serde(from = "Dep", into = "Dep")]
4443
pub(crate) struct ReleaseDependency(Dependency);
4544

4645
impl ReleaseDependency {
@@ -49,25 +48,31 @@ impl ReleaseDependency {
4948
}
5049
}
5150

52-
impl From<DepIn> for ReleaseDependency {
53-
fn from((name, req, kind, optional): DepIn) -> Self {
51+
impl From<Dep> for ReleaseDependency {
52+
fn from((name, req, kind, optional): Dep) -> Self {
5453
ReleaseDependency(
5554
DependencyBuilder::default()
5655
.name(name)
56+
.source(None)
5757
.req(req)
5858
.kind(kind.unwrap_or_default())
5959
.optional(optional.unwrap_or(false))
60+
.uses_default_features(false)
61+
.features(vec![])
62+
.target(None)
6063
.rename(None)
64+
.registry(None)
65+
.path(None)
6166
.build()
6267
.expect("we know the data is correct"),
6368
)
6469
}
6570
}
6671

67-
impl From<ReleaseDependency> for DepOut {
72+
impl From<ReleaseDependency> for Dep {
6873
fn from(rd: ReleaseDependency) -> Self {
6974
let d = rd.0;
70-
(d.name, d.req, d.kind, d.optional)
75+
(d.name, d.req, Some(d.kind), Some(d.optional))
7176
}
7277
}
7378

0 commit comments

Comments
 (0)