From d6b544771fa45a7cbe4fc51b96f722bced83d2bc Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 19 Sep 2022 12:28:41 +0100 Subject: [PATCH] Rename function for simplicity --- lib/src/sql/value/value.rs | 4 ++-- src/iam/signin.rs | 2 +- src/iam/signup.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index f5080ff1..0508f504 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -842,14 +842,14 @@ impl Value { // ----------------------------------- /// Fetch the record id if there is one - pub fn rid(self) -> Option { + pub fn record(self) -> Option { match self { Value::Object(mut v) => match v.remove("id") { Some(Value::Thing(v)) => Some(v), _ => None, }, Value::Array(mut v) => match v.len() { - 1 => v.remove(0).rid(), + 1 => v.remove(0).record(), _ => None, }, Value::Thing(v) => Some(v), diff --git a/src/iam/signin.rs b/src/iam/signin.rs index 7b73fb74..398fb2fb 100644 --- a/src/iam/signin.rs +++ b/src/iam/signin.rs @@ -123,7 +123,7 @@ pub async fn sc( // Compute the value with the params match kvs.compute(val, &sess, vars, opt.strict).await { // The signin value succeeded - Ok(val) => match val.rid() { + Ok(val) => match val.record() { // There is a record returned Some(rid) => { // Create the authentication key diff --git a/src/iam/signup.rs b/src/iam/signup.rs index ecf0d7fe..fef6ad4c 100644 --- a/src/iam/signup.rs +++ b/src/iam/signup.rs @@ -58,7 +58,7 @@ pub async fn sc( // Compute the value with the params match kvs.compute(val, &sess, vars, opt.strict).await { // The signin value succeeded - Ok(val) => match val.rid() { + Ok(val) => match val.record() { // There is a record returned Some(rid) => { // Create the authentication key