-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
@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. |
backend/src/github.rs
Outdated
let mut clean_issues: Vec<Issue> = vec![]; | ||
for issue in json_response { | ||
if !issue.node_id.starts_with("PR_") { | ||
clean_issues.push(issue); | ||
} | ||
} |
There was a problem hiding this comment.
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
backend/src/github.rs
Outdated
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) |
There was a problem hiding this comment.
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
…-use_chrono_serde
…list-languages # Conflicts: # backend/Cargo.toml
No description provided.