Skip to content

Commit 9d97b92

Browse files
committed
Make it possible to document usage of GitHub Sponsors
1 parent 2a65ad8 commit 9d97b92

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

docs/toml-schema.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ email = "[email protected]" # Email address used for mailing lists (optional)
1717
irc = "jdoe" # Nickname of the person on IRC, if different than the GitHub one (optional)
1818
matrix = "@john:doe.com" # Matrix username (MXID) of the person (optional)
1919

20+
[funding]
21+
# Optional, specify that you have GitHub Sponsors enabled and you
22+
# are looking for sponsors to fund your work on Rust.
23+
github-sponsors = true
24+
2025
[permissions]
2126
# Optional, see the permissions documentation
2227
```

rust_team_data/src/v1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ pub struct Person {
249249
pub name: String,
250250
pub email: Option<String>,
251251
pub github_id: u64,
252+
pub github_sponsors: bool,
252253
}
253254

254255
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]

src/schema.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ pub(crate) enum Email<'a> {
6565
Present(&'a str),
6666
}
6767

68+
#[derive(serde_derive::Deserialize, Debug, Default)]
69+
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
70+
pub(crate) struct Funding {
71+
github_sponsors: bool,
72+
}
73+
6874
#[derive(serde_derive::Deserialize, Debug)]
6975
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
7076
pub(crate) struct Person {
@@ -78,6 +84,8 @@ pub(crate) struct Person {
7884
discord_id: Option<u64>,
7985
matrix: Option<String>,
8086
#[serde(default)]
87+
funding: Funding,
88+
#[serde(default)]
8189
permissions: Permissions,
8290
}
8391

@@ -98,6 +106,10 @@ impl Person {
98106
self.zulip_id
99107
}
100108

109+
pub(crate) fn has_github_sponsors(&self) -> bool {
110+
self.funding.github_sponsors
111+
}
112+
101113
#[allow(unused)]
102114
pub(crate) fn irc(&self) -> &str {
103115
if let Some(irc) = &self.irc {

src/static_api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ impl<'a> Generator<'a> {
367367
Email::Present(s) => Some(s.into()),
368368
},
369369
github_id: person.github_id(),
370+
github_sponsors: person.has_github_sponsors(),
370371
},
371372
);
372373
}

0 commit comments

Comments
 (0)