summaryrefslogtreecommitdiffstats
path: root/rust/src/api_server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-07 19:36:11 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-07 19:36:11 -0700
commit20c5cf5a8b9acf98db7487ab49de8dcbc1ddb2f9 (patch)
treeae2cbb555f3bd9992b0bb85ceb5d73b33cfc6581 /rust/src/api_server.rs
parent47cb21bdc31466dd827800898a4ad543a6297696 (diff)
downloadfatcat-20c5cf5a8b9acf98db7487ab49de8dcbc1ddb2f9.tar.gz
fatcat-20c5cf5a8b9acf98db7487ab49de8dcbc1ddb2f9.zip
fix/replace a lot of expect() calls
Diffstat (limited to 'rust/src/api_server.rs')
-rw-r--r--rust/src/api_server.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index ecf0c242..57aeebea 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -49,7 +49,7 @@ macro_rules! count_entity {
fn make_edit_context(conn: &DbConn, editgroup_id: Option<FatCatId>) -> Result<EditContext> {
let editor_id = Uuid::parse_str("00000000-0000-0000-AAAA-000000000001")?; // TODO: auth
let editgroup_id = match editgroup_id {
- None => FatCatId::from_uuid(&get_or_create_editgroup(editor_id, conn).expect("current editgroup")),
+ None => FatCatId::from_uuid(&get_or_create_editgroup(editor_id, conn)?),
Some(param) => param,
};
Ok(EditContext {
@@ -386,8 +386,7 @@ impl Server {
editgroup::description.eq(entity.description),
editgroup::extra_json.eq(entity.extra),
))
- .get_result(conn)
- .expect("error creating edit group");
+ .get_result(conn)?;
Ok(Editgroup {
id: Some(uuid2fcid(&row.id)),