Skip to content

Commit

Permalink
refactor: remove unnecessary fallible conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
c-git committed Dec 23, 2024
1 parent c3cd2fc commit 8a6ada3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/wykies-server/src/routes/admin/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,7 @@ pub async fn user_update(
Some(Some(x)) => Some(x.try_into().map_err(e500)?),
Some(None) | None => None,
};
let failed_attempts: Option<i16> = diff
.failed_attempts
.map(|x| x.try_into())
.transpose()
.map_err(e500)?;
let failed_attempts: Option<i16> = diff.failed_attempts.map(|x| x.into());
sqlx::query!(
"UPDATE users SET
display_name = CASE WHEN $1 THEN display_name ELSE $2 end,
Expand Down

0 comments on commit 8a6ada3

Please sign in to comment.