summaryrefslogtreecommitdiff
path: root/src/repo/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/repo/token.rs')
-rw-r--r--src/repo/token.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/repo/token.rs b/src/repo/token.rs
index 01a982e..5674c92 100644
--- a/src/repo/token.rs
+++ b/src/repo/token.rs
@@ -88,7 +88,7 @@ impl<'c> Tokens<'c> {
&mut self,
secret: &str,
used_at: DateTime,
- ) -> Result<Option<Login>, sqlx::Error> {
+ ) -> Result<Login, sqlx::Error> {
// I would use `update … returning` to do this in one query, but
// sqlite3, as of this writing, does not allow an update's `returning`
// clause to reference columns from tables joined into the update. Two
@@ -117,7 +117,7 @@ impl<'c> Tokens<'c> {
"#,
secret,
)
- .fetch_optional(&mut *self.0)
+ .fetch_one(&mut *self.0)
.await?;
Ok(login)