diff options
author | Dennis Kobert <dennis@kobert.dev> | 2020-02-12 23:10:53 +0000 |
---|---|---|
committer | Dennis Kobert <dennis@kobert.dev> | 2020-02-12 23:10:53 +0000 |
commit | 4549ea0df1e0026443afb3ff06bec3ad64a5ad94 (patch) | |
tree | 5214ba7fcc3b3138d14ca058d3cffebbb0732825 | |
parent | 80558027d43840c9b246a87068740cd39a033762 (diff) |
Fix typo in error handling
-rw-r--r-- | src/serve.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/serve.rs b/src/serve.rs index 9d12a03..67d49ae 100644 --- a/src/serve.rs +++ b/src/serve.rs @@ -41,8 +41,10 @@ pub fn get_tracks(name: String, url: String) -> Result<(), status::Custom<String &[&user_id], ) .unwrap(); - let uid = get_uid(user_id.as_ref(), &mut client) - .ok_or(status::NotFound(format!("username {} not found", user_id)))?; + let uid = get_uid(user_id.as_ref(), &mut client).ok_or(status::Custom( + Status::NotFound, + format!("username {} not found", user_id), + ))?; client .execute("DELETE FROM user_track WHERE user_id = $1;", &[&uid]) .unwrap(); |