We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a52db5 commit 6286ec6Copy full SHA for 6286ec6
src/krate.rs
@@ -1030,13 +1030,12 @@ pub fn downloads(req: &mut Request) -> CargoResult<Response> {
1030
AND versions.id != ALL($3)
1031
GROUP BY DATE(version_downloads.date)
1032
ORDER BY DATE(version_downloads.date) ASC")?;
1033
- let mut extra = Vec::new();
1034
- for row in stmt.query(&[&cutoff_date, &krate.id, &ids])?.iter() {
1035
- extra.push(ExtraDownload {
+ let extra = stmt.query(&[&cutoff_date, &krate.id, &ids])?.iter().map(|row| {
+ ExtraDownload {
1036
downloads: row.get("downloads"),
1037
date: row.get("date")
1038
- });
1039
- }
+ }
+ }).collect::<Vec<_>>();
1040
1041
#[derive(RustcEncodable)]
1042
struct ExtraDownload { date: String, downloads: i64 }
0 commit comments