From cbf615dda68367600c47c6867d27737c0113ca39 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 9 Jan 2019 12:42:02 -0800 Subject: refactor to have consistent db conn argument order 'conn' parameter always comes first. --- rust/src/editing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rust/src/editing.rs') diff --git a/rust/src/editing.rs b/rust/src/editing.rs index b501a6cf..b488e489 100644 --- a/rust/src/editing.rs +++ b/rust/src/editing.rs @@ -45,7 +45,7 @@ pub fn make_edit_context( .get_result(conn)?; FatCatId::from_uuid(&eg_row.id) } - (None, false) => FatCatId::from_uuid(&get_or_create_editgroup(editor_id.to_uuid(), conn)?), + (None, false) => FatCatId::from_uuid(&get_or_create_editgroup(conn, editor_id.to_uuid())?), }; Ok(EditContext { editor_id, @@ -86,7 +86,7 @@ pub fn update_editor_username( } /// This function should always be run within a transaction -pub fn get_or_create_editgroup(editor_id: Uuid, conn: &DbConn) -> Result { +pub fn get_or_create_editgroup(conn: &DbConn, editor_id: Uuid) -> Result { // check for current active let ed_row: EditorRow = editor::table.find(editor_id).first(conn)?; if let Some(current) = ed_row.active_editgroup_id { @@ -104,7 +104,7 @@ pub fn get_or_create_editgroup(editor_id: Uuid, conn: &DbConn) -> Result { } /// This function should always be run within a transaction -pub fn accept_editgroup(editgroup_id: FatCatId, conn: &DbConn) -> Result { +pub fn accept_editgroup(conn: &DbConn, editgroup_id: FatCatId) -> Result { // check that we haven't accepted already (in changelog) // NB: could leave this to a UNIQUE constraint // TODO: redundant with check_edit_context -- cgit v1.2.3