Skip to content

Commit

Permalink
Try to add links to the index
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Feb 26, 2018
1 parent 63e987e commit 621ca98
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controllers/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub fn publish(req: &mut Request) -> CargoResult<Response> {

let name = &*new_crate.name;
let vers = &*new_crate.vers;
let links = new_crate.links.clone();
let repo = new_crate.repository.as_ref().map(|s| &**s);
let features = new_crate
.features
Expand Down Expand Up @@ -147,6 +148,7 @@ pub fn publish(req: &mut Request) -> CargoResult<Response> {
features: features,
deps: git_deps,
yanked: Some(false),
links,
};
git::add_crate(&**req.app(), &git_crate).chain_error(|| {
internal(&format_args!(
Expand Down
2 changes: 2 additions & 0 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub struct Crate {
pub cksum: String,
pub features: HashMap<String, Vec<String>>,
pub yanked: Option<bool>,
#[serde(default)]
pub links: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down
1 change: 1 addition & 0 deletions src/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ fn new_req_body(
license_file: None,
repository: krate.repository,
badges: Some(badges),
links: None,
},
&[],
)
Expand Down
1 change: 1 addition & 0 deletions src/tests/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fn new_crate(name: &str) -> u::NewCrate {
license_file: None,
repository: None,
badges: None,
links: None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/views/krate_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ pub struct NewCrate {
pub license_file: Option<String>,
pub repository: Option<String>,
pub badges: Option<HashMap<String, HashMap<String, String>>>,
#[serde(default)]
pub links: Option<String>,
}

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

0 comments on commit 621ca98

Please sign in to comment.