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" 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::>()), } } }