@@ -121,7 +121,7 @@ async fn insert_github(
121121 username : & str ,
122122 conn : & mut PgConnection ,
123123) -> Result < Developer , ApiError > {
124- Ok ( sqlx:: query_as!(
124+ sqlx:: query_as!(
125125 Developer ,
126126 "INSERT INTO developers(username, display_name, github_user_id)
127127 VALUES ($1, $1, $2)
@@ -140,11 +140,11 @@ async fn insert_github(
140140 . map_err ( |e| {
141141 log:: error!( "Failed to insert developer: {}" , e) ;
142142 ApiError :: DbError
143- } ) ? )
143+ } )
144144}
145145
146146pub async fn get_one ( id : i32 , conn : & mut PgConnection ) -> Result < Option < Developer > , ApiError > {
147- Ok ( sqlx:: query_as!(
147+ sqlx:: query_as!(
148148 Developer ,
149149 "SELECT
150150 id,
@@ -162,14 +162,14 @@ pub async fn get_one(id: i32, conn: &mut PgConnection) -> Result<Option<Develope
162162 . map_err ( |e| {
163163 log:: error!( "Failed to fetch developer {}: {}" , id, e) ;
164164 ApiError :: DbError
165- } ) ? )
165+ } )
166166}
167167
168168pub async fn get_one_by_username (
169169 username : & str ,
170170 conn : & mut PgConnection ,
171171) -> Result < Option < Developer > , ApiError > {
172- Ok ( sqlx:: query_as!(
172+ sqlx:: query_as!(
173173 Developer ,
174174 "SELECT
175175 id,
@@ -187,14 +187,14 @@ pub async fn get_one_by_username(
187187 . map_err ( |e| {
188188 log:: error!( "Failed to fetch developer {}: {}" , username, e) ;
189189 ApiError :: DbError
190- } ) ? )
190+ } )
191191}
192192
193193pub async fn get_all_for_mod (
194194 mod_id : & str ,
195195 conn : & mut PgConnection ,
196196) -> Result < Vec < ModDeveloper > , ApiError > {
197- Ok ( sqlx:: query_as!(
197+ sqlx:: query_as!(
198198 ModDeveloper ,
199199 "SELECT
200200 dev.id,
@@ -211,7 +211,7 @@ pub async fn get_all_for_mod(
211211 . map_err ( |e| {
212212 log:: error!( "Failed to fetch developers for mod {}: {}" , mod_id, e) ;
213213 ApiError :: DbError
214- } ) ? )
214+ } )
215215}
216216
217217pub async fn get_all_for_mods (
@@ -323,7 +323,7 @@ pub async fn get_owner_for_mod(
323323 mod_id : & str ,
324324 conn : & mut PgConnection ,
325325) -> Result < Developer , ApiError > {
326- Ok ( sqlx:: query_as!(
326+ sqlx:: query_as!(
327327 Developer ,
328328 "SELECT
329329 dev.id,
@@ -349,7 +349,7 @@ pub async fn get_owner_for_mod(
349349 log:: error!( "Failed to fetch owner for mod {}" , mod_id) ;
350350 ApiError :: InternalError
351351 }
352- } ) ? )
352+ } )
353353}
354354
355355pub async fn update_status (
@@ -358,7 +358,7 @@ pub async fn update_status(
358358 admin : bool ,
359359 conn : & mut PgConnection ,
360360) -> Result < Developer , ApiError > {
361- Ok ( sqlx:: query_as!(
361+ sqlx:: query_as!(
362362 Developer ,
363363 "UPDATE developers
364364 SET admin = $1,
@@ -380,15 +380,15 @@ pub async fn update_status(
380380 . map_err ( |e| {
381381 log:: error!( "Failed to update developer {}: {}" , dev_id, e) ;
382382 ApiError :: DbError
383- } ) ? )
383+ } )
384384}
385385
386386pub async fn update_profile (
387387 dev_id : i32 ,
388388 display_name : & str ,
389389 conn : & mut PgConnection ,
390390) -> Result < Developer , ApiError > {
391- Ok ( sqlx:: query_as!(
391+ sqlx:: query_as!(
392392 Developer ,
393393 "UPDATE developers
394394 SET display_name = $1
@@ -408,15 +408,15 @@ pub async fn update_profile(
408408 . map_err ( |e| {
409409 log:: error!( "Failed to update profile for {}: {}" , dev_id, e) ;
410410 ApiError :: DbError
411- } ) ? )
411+ } )
412412}
413413
414414pub async fn find_by_refresh_token (
415415 uuid : Uuid ,
416416 conn : & mut PgConnection ,
417417) -> Result < Option < Developer > , ApiError > {
418418 let hash = sha256:: digest ( uuid. to_string ( ) ) ;
419- Ok ( sqlx:: query_as!(
419+ sqlx:: query_as!(
420420 Developer ,
421421 "SELECT
422422 d.id,
@@ -436,5 +436,5 @@ pub async fn find_by_refresh_token(
436436 . map_err ( |e| {
437437 log:: error!( "Failed to search for developer by refresh token: {}" , e) ;
438438 ApiError :: DbError
439- } ) ? )
439+ } )
440440}
0 commit comments