Skip to content

Commit 34af970

Browse files
committed
Add getopts
1 parent aec96c8 commit 34af970

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

repos/rust-lang/getopts.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
org = 'rust-lang'
2+
name = 'getopts'
3+
description = 'The getopts repo maintained by the rust-lang project'
4+
bots = []
5+
6+
[access.teams]
7+
libs-contributors = 'maintain'

src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ pub(crate) struct GitHubMember {
274274

275275
#[derive(serde::Deserialize, Debug)]
276276
pub(crate) struct Repo {
277-
pub(crate) description: String,
277+
pub(crate) description: Option<String>,
278278
}
279279

280280
#[derive(serde::Deserialize, Debug)]

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ fn run() -> Result<(), Error> {
170170
#[derive(serde::Serialize, Debug)]
171171
#[serde(rename_all = "kebab-case")]
172172
struct AccessToAdd {
173+
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
173174
teams: HashMap<String, String>,
175+
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
174176
individuals: HashMap<String, String>,
175177
}
176178
#[derive(serde::Serialize, Debug)]
@@ -241,7 +243,9 @@ fn run() -> Result<(), Error> {
241243
let repo = RepoToAdd {
242244
org: &org,
243245
name: &name,
244-
description: &repo.description,
246+
description: &repo.description.unwrap_or_else(|| {
247+
format!("The {name} repo maintained by the rust-lang project")
248+
}),
245249
bots,
246250
access: AccessToAdd { teams, individuals },
247251
branch: branches,

0 commit comments

Comments
 (0)