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 924fb22 commit 9c679e4Copy full SHA for 9c679e4
src/category.rs
@@ -118,7 +118,7 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
118
let conn = try!(req.tx());
119
let (offset, limit) = try!(req.pagination(10, 100));
120
let query = req.query();
121
- let sort = query.get("sort").map(|s| &s[..]).unwrap_or("alpha");
+ let sort = query.get("sort").map_or("alpha", String::as_str);
122
let sort_sql = match sort {
123
"crates" => "ORDER BY crates_cnt DESC",
124
_ => "ORDER BY category ASC",
0 commit comments