Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): list languages #3

Merged
merged 5 commits into from
Sep 22, 2022
Merged

Conversation

aldy505
Copy link
Member

@aldy505 aldy505 commented Sep 22, 2022

No description provided.

@aldy505 aldy505 added the enhancement New feature or request label Sep 22, 2022
@aldy505 aldy505 self-assigned this Sep 22, 2022
@aldy505
Copy link
Member Author

aldy505 commented Sep 22, 2022

@ii64 gw ada pindahin urutan buat structnya biar di define di atas semua. ini dibawah karena bekas yang lama, sebelomnya dia ngga pake struct+impl, tapi pure pub fn, dan struct buat response dari githubnya gw bikin diatas masing-masing function.

Comment on lines 126 to 131
let mut clean_issues: Vec<Issue> = vec![];
for issue in json_response {
if !issue.node_id.starts_with("PR_") {
clean_issues.push(issue);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pake filter dong biar ganteng xixixi

Comment on lines 145 to 164
let mut language_set: Vec<(String, i64)> = vec![];

for (key, value) in &json_response {
language_set.push((String::from(key), *value));
}
json_response.clear();

language_set.sort_by(|a, b| {
let (_, a_bytes) = a;
let (_, b_bytes) = b;

b_bytes.cmp(a_bytes)
});

let mut languages: Vec<String> = vec![];
for (language, _) in language_set {
languages.push(language);
}

Ok(languages)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ini juga, enak pake .map biar sok ganteng

@aldy505 aldy505 mentioned this pull request Sep 22, 2022
@ii64 ii64 merged commit b90ebd3 into feat/backend Sep 22, 2022
@ii64 ii64 deleted the feat/backend-list-languages branch September 22, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants