Skip to content

Commit

Permalink
Return unmodified dependency requirement from `GET /crates/:crate_id/…
Browse files Browse the repository at this point in the history
…:version/dependencies`
  • Loading branch information
Turbo87 committed Nov 27, 2020
1 parent 433237d commit 3da9ed8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/models/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Dependency {
pub id: i32,
pub version_id: i32,
pub crate_id: i32,
pub req: semver::VersionReq,
pub req: String,
pub optional: bool,
pub default_features: bool,
pub features: Vec<String>,
Expand Down Expand Up @@ -51,7 +51,7 @@ impl Dependency {
id: self.id,
version_id: self.version_id,
crate_id: crate_name.into(),
req: self.req.to_string(),
req: self.req,
optional: self.optional,
default_features: self.default_features,
features: self.features,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ fn new_krate_with_dependency() {

assert_eq!(dependencies.len(), 1);
assert_eq!(dependencies[0].crate_id, "foo-dep");
assert_eq!(dependencies[0].req, ">=1.0.0, <2.0.0");
assert_eq!(dependencies[0].req, "1.0.0");
}

#[test]
Expand Down

0 comments on commit 3da9ed8

Please sign in to comment.