Rename the lists index handler for consistency

This commit is contained in:
Paul van Tilburg 2017-12-30 13:48:07 +01:00
parent 51d3e876d6
commit c2baff37f3
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ fn index(lists: State<ListStore>) -> Template {
}
#[get("/lists", format = "application/json")]
fn lists(lists: State<ListStore>) -> Option<Json<Vec<List>>> {
fn list_index(lists: State<ListStore>) -> Option<Json<Vec<List>>> {
let lists = lists.read().unwrap();
Some(Json(lists.clone()))
}
@ -71,7 +71,7 @@ fn rocket() -> Rocket {
let lists = list::List::load_all();
rocket::ignite()
.manage(RwLock::new(lists))
.mount("/", routes![index, lists, list_show_html, list_show_json, list_update, static_files::all])
.mount("/", routes![index, list_index, list_show_html, list_show_json, list_update, static_files::all])
.attach(Template::fairing())
}