Skip to content

Commit 421a025

Browse files
committed
Move all names to snake_case (remove some laziness)
1 parent 56c0dc2 commit 421a025

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/gitlab/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ query ListRustRepos($after: String) {
3232
"#;
3333

3434
#[derive(Debug, Deserialize)]
35+
#[serde(rename_all = "camelCase")]
3536
struct PageInfo {
36-
hasNextPage: bool,
37-
endCursor: Option<String>,
37+
has_next_page: bool,
38+
end_cursor: Option<String>,
3839
}
3940

4041
#[derive(Debug, Deserialize)]
@@ -48,13 +49,9 @@ struct Project {
4849
}
4950

5051
#[derive(Debug, Deserialize)]
51-
struct Namespace {
52-
fullPath: String,
53-
}
54-
55-
#[derive(Debug, Deserialize)]
52+
#[serde(rename_all = "camelCase")]
5653
struct Projects {
57-
pageInfo: PageInfo,
54+
page_info: PageInfo,
5855
nodes: Vec<Project>,
5956
}
6057

@@ -111,12 +108,12 @@ pub fn scrape(data: &Data, config: &Config, should_stop: &AtomicBool) -> Fallibl
111108
)?;
112109
}
113110

114-
if !projects.pageInfo.hasNextPage {
111+
if !projects.page_info.has_next_page {
115112
println!("No more pages");
116113
break;
117114
}
118115

119-
after = projects.pageInfo.endCursor;
116+
after = projects.page_info.end_cursor;
120117
page += 1;
121118
}
122119

0 commit comments

Comments
 (0)