From f723a666f5d210550bedd950b1407946dc55d40d Mon Sep 17 00:00:00 2001 From: Leif Grele Date: Mon, 4 Jul 2016 20:18:09 -0400 Subject: [PATCH 1/2] Bump Syntex version. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 09d98824..aaf16d6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ env_logger="0.3" [build-dependencies] serde_codegen = "0.7" -syntex = "0.35" +syntex = "0.37" [dependencies] log = "0.3" From 66424ebc87ab62b7229229c9bafea8f3236be0b3 Mon Sep 17 00:00:00 2001 From: Leif Grele Date: Mon, 4 Jul 2016 20:22:11 -0400 Subject: [PATCH 2/2] Make all elements of IssueOptions Options. All parameters for the api endpoint are optional --- src/rep.rs.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/rep.rs.in b/src/rep.rs.in index f462fae4..d7ae054b 100644 --- a/src/rep.rs.in +++ b/src/rep.rs.in @@ -1156,22 +1156,24 @@ impl IssueListOptionsBuilder { #[derive(Debug, Serialize)] pub struct IssueOptions { - pub title: String, + #[serde(skip_serializing_if="Option::is_none")] + pub title: Option, #[serde(skip_serializing_if="Option::is_none")] pub body: Option, #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] pub milestone: Option, - pub labels: Vec, + #[serde(skip_serializing_if="Option::is_none")] + pub labels: Option>, } impl IssueOptions { - pub fn new(title: T, + pub fn new(title: Option, body: Option, assignee: Option, milestone: Option, - labels: Vec) + labels: Option>) -> IssueOptions where T: Into, B: Into, @@ -1179,11 +1181,11 @@ impl IssueOptions { L: Into { IssueOptions { - title: title.into(), + title: title.map(|t| t.into()), body: body.map(|b| b.into()), assignee: assignee.map(|a| a.into()), milestone: milestone, - labels: labels.into_iter().map(|l| l.into()).collect::>(), + labels: labels.map(|lb| lb.into_iter().map(|l| l.into()).collect::>()), } } }