Skip to content

Commit 621ca98

Browse files
committed
Try to add links to the index
1 parent 63e987e commit 621ca98

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

src/controllers/krate/publish.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub fn publish(req: &mut Request) -> CargoResult<Response> {
3030

3131
let name = &*new_crate.name;
3232
let vers = &*new_crate.vers;
33+
let links = new_crate.links.clone();
3334
let repo = new_crate.repository.as_ref().map(|s| &**s);
3435
let features = new_crate
3536
.features
@@ -147,6 +148,7 @@ pub fn publish(req: &mut Request) -> CargoResult<Response> {
147148
features: features,
148149
deps: git_deps,
149150
yanked: Some(false),
151+
links,
150152
};
151153
git::add_crate(&**req.app(), &git_crate).chain_error(|| {
152154
internal(&format_args!(

src/git.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ pub struct Crate {
2121
pub cksum: String,
2222
pub features: HashMap<String, Vec<String>>,
2323
pub yanked: Option<bool>,
24+
#[serde(default)]
25+
pub links: Option<String>,
2426
}
2527

2628
#[derive(Serialize, Deserialize, Debug)]

src/tests/all.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ fn new_req_body(
660660
license_file: None,
661661
repository: krate.repository,
662662
badges: Some(badges),
663+
links: None,
663664
},
664665
&[],
665666
)

src/tests/krate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ fn new_crate(name: &str) -> u::NewCrate {
8181
license_file: None,
8282
repository: None,
8383
badges: None,
84+
links: None,
8485
}
8586
}
8687

src/views/krate_publish.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub struct NewCrate {
3131
pub license_file: Option<String>,
3232
pub repository: Option<String>,
3333
pub badges: Option<HashMap<String, HashMap<String, String>>>,
34+
#[serde(default)]
35+
pub links: Option<String>,
3436
}
3537

3638
#[derive(PartialEq, Eq, Hash, Serialize, Debug, Deref)]

0 commit comments

Comments
 (0)