aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/editing.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-09 12:42:02 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-09 12:42:08 -0800
commitcbf615dda68367600c47c6867d27737c0113ca39 (patch)
tree8adb24be8f9e1a3eefd9253181d79bf7690b90ba /rust/src/editing.rs
parent8bd35d2b452cef9d4537e2b84180aad0f43347ac (diff)
downloadfatcat-cbf615dda68367600c47c6867d27737c0113ca39.tar.gz
fatcat-cbf615dda68367600c47c6867d27737c0113ca39.zip
refactor to have consistent db conn argument order
'conn' parameter always comes first.
Diffstat (limited to 'rust/src/editing.rs')
-rw-r--r--rust/src/editing.rs6
1 files changed, 3 insertions, 3 deletions
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<Uuid> {
+pub fn get_or_create_editgroup(conn: &DbConn, editor_id: Uuid) -> Result<Uuid> {
// 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<Uuid> {
}
/// This function should always be run within a transaction
-pub fn accept_editgroup(editgroup_id: FatCatId, conn: &DbConn) -> Result<ChangelogRow> {
+pub fn accept_editgroup(conn: &DbConn, editgroup_id: FatCatId) -> Result<ChangelogRow> {
// check that we haven't accepted already (in changelog)
// NB: could leave this to a UNIQUE constraint
// TODO: redundant with check_edit_context