Skip to content

Commit 1acfbef

Browse files
committed
cargo fmt
1 parent 20f42d9 commit 1acfbef

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/krate.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,10 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
809809
if sort == "downloads" {
810810
query = query.order((perfect_match, crates::downloads.desc()));
811811
} else if sort == "recent-downloads" {
812-
query = query.order((perfect_match, recent_downloads.clone().desc().nulls_last()));
812+
query = query.order((
813+
perfect_match,
814+
recent_downloads.clone().desc().nulls_last(),
815+
));
813816
} else {
814817
let rank = ts_rank_cd(crates::textsearchable_index_col, q);
815818
query = query.order((perfect_match, rank.desc()))

src/tests/krate.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ fn exact_match_on_queries_with_sort() {
378378
// Test for bug with showing null results first when sorting
379379
// by descending
380380
// This has nothing to do with querying for exact match I'm sorry
381-
let mut response = ok_resp!(middle.call(
382-
req.with_query("sort=recent-downloads"),
383-
));
381+
let mut response = ok_resp!(middle.call(req.with_query("sort=recent-downloads")));
384382
let json: CrateList = ::json(&mut response);
385383
assert_eq!(json.meta.total, 4);
386384
assert_eq!(json.crates[0].name, "foo_sort");

0 commit comments

Comments
 (0)