Skip to content

Commit 92b937e

Browse files
committed
added the exact_match field to encodablecrate
1 parent 4082d4e commit 92b937e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/krate.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub struct EncodableCrate {
8787
pub license: Option<String>,
8888
pub repository: Option<String>,
8989
pub links: CrateLinks,
90+
pub exact_match: bool,
9091
}
9192

9293
#[derive(RustcEncodable, RustcDecodable)]
@@ -392,15 +393,16 @@ impl Crate {
392393
pub fn minimal_encodable(self,
393394
max_version: semver::Version,
394395
badges: Option<Vec<Badge>>) -> EncodableCrate {
395-
self.encodable(max_version, None, None, None, badges)
396+
self.encodable(max_version, None, None, None, badges, false)
396397
}
397398

398399
pub fn encodable(self,
399400
max_version: semver::Version,
400401
versions: Option<Vec<i32>>,
401402
keywords: Option<&[Keyword]>,
402403
categories: Option<&[Category]>,
403-
badges: Option<Vec<Badge>>)
404+
badges: Option<Vec<Badge>>,
405+
exact_match: bool)
404406
-> EncodableCrate {
405407
let Crate {
406408
name, created_at, updated_at, downloads, description,
@@ -428,6 +430,7 @@ impl Crate {
428430
max_version: max_version.to_string(),
429431
documentation: documentation,
430432
homepage: homepage,
433+
exact_match: exact_match,
431434
description: description,
432435
license: license,
433436
repository: repository,
@@ -841,7 +844,7 @@ pub fn show(req: &mut Request) -> CargoResult<Response> {
841844
}
842845
Ok(req.json(&R {
843846
krate: krate.clone().encodable(
844-
max_version, Some(ids), Some(&kws), Some(&cats), Some(badges)
847+
max_version, Some(ids), Some(&kws), Some(&cats), Some(badges), false
845848
),
846849
versions: versions.into_iter().map(|v| {
847850
v.encodable(&krate.name)

0 commit comments

Comments
 (0)