Skip to content

Commit 42f84a3

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

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/gitlab/mod.rs

Lines changed: 8 additions & 11 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)]
@@ -44,17 +45,13 @@ struct Project {
4445
name: String,
4546
full_path: String,
4647
path: String,
47-
webUrl: String,
48-
}
49-
50-
#[derive(Debug, Deserialize)]
51-
struct Namespace {
52-
fullPath: String,
48+
web_url: String,
5349
}
5450

5551
#[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)