From 35ce912f2a65ca97b009d824947e4e558b84c1ae Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Wed, 19 Jun 2024 20:45:02 +0200 Subject: [PATCH] Remove forgotten unwrap --- src/controllers/users_controller.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/users_controller.rs b/src/controllers/users_controller.rs index 80cdcce..56b4026 100644 --- a/src/controllers/users_controller.rs +++ b/src/controllers/users_controller.rs @@ -63,8 +63,8 @@ pub async fn show_user<'r>( pub async fn show_ssh_key<'r>( db: DbConn, username: String, -) -> Json> { - let user = User::find_by_username(username, &db).await.unwrap(); +) -> Result>> { + let user = User::find_by_username(username, &db).await?; let mut keys = vec![]; if let Some(ssh_keys) = user.ssh_key { for line in ssh_keys.lines() { @@ -74,7 +74,7 @@ pub async fn show_ssh_key<'r>( } } } - Json(keys) + Ok(Json(keys)) } #[get("/users")]