Remove unnecassary mutables
This commit is contained in:
parent
131ffd7a23
commit
4a2f16d6ff
@ -84,11 +84,11 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
.await
|
.await
|
||||||
.context("Failed to connect to database")?;
|
.context("Failed to connect to database")?;
|
||||||
|
|
||||||
let mut state = AppState {
|
let state = AppState {
|
||||||
storage,
|
storage,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(route_index))
|
.route("/", get(route_index))
|
||||||
.route("/flakes", get(route_flakes))
|
.route("/flakes", get(route_flakes))
|
||||||
.route("/f/{uri}", get(route_flake_info))
|
.route("/f/{uri}", get(route_flake_info))
|
||||||
@ -106,9 +106,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn route_index(
|
async fn route_index() -> Result<impl IntoResponse, AppError> {
|
||||||
State(state): State<AppState>,
|
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
|
||||||
Ok(render_template(&IndexTemplate {})?)
|
Ok(render_template(&IndexTemplate {})?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user