diff options
| author | Kit La Touche <kit@transneptune.net> | 2025-02-21 22:18:56 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2025-02-21 22:53:49 -0500 |
| commit | 9d1dbac74866a6175c65a25bbd8a3ccbe8cf87e4 (patch) | |
| tree | f15b3f0695b948e335774aa4d92a5b064a1c0f10 /src/login/create.rs | |
| parent | 743b59b69857da81b214970ec9252bc918ad243d (diff) | |
| parent | 36cadfe00cacc6a6523f9862d3f7a08a9d0ce611 (diff) | |
Merge branch 'main' into prop/preserve-state
Diffstat (limited to 'src/login/create.rs')
| -rw-r--r-- | src/login/create.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/login/create.rs b/src/login/create.rs index 693daaf..c5cea08 100644 --- a/src/login/create.rs +++ b/src/login/create.rs @@ -7,6 +7,7 @@ use crate::{ name::Name, }; +#[must_use = "dropping a login creation attempt is likely a mistake"] pub struct Create<'a> { name: &'a Name, password: &'a Password, @@ -14,7 +15,6 @@ pub struct Create<'a> { } impl<'a> Create<'a> { - #[must_use = "dropping a login creation attempt is likely a mistake"] pub fn begin(name: &'a Name, password: &'a Password, created_at: &'a DateTime) -> Self { Self { name, @@ -23,7 +23,6 @@ impl<'a> Create<'a> { } } - #[must_use = "dropping a login creation attempt is likely a mistake"] pub fn validate(self) -> Result<Validated<'a>, Error> { let Self { name, @@ -45,15 +44,15 @@ impl<'a> Create<'a> { } } +#[must_use = "dropping a login creation attempt is likely a mistake"] pub struct Validated<'a> { name: &'a Name, password_hash: StoredHash, created_at: &'a DateTime, } -impl<'a> Validated<'a> { - #[must_use = "dropping a login creation attempt is likely a mistake"] - pub async fn store<'c>(self, tx: &mut Transaction<'c, Sqlite>) -> Result<Stored, sqlx::Error> { +impl Validated<'_> { + pub async fn store(self, tx: &mut Transaction<'_, Sqlite>) -> Result<Stored, sqlx::Error> { let Self { name, password_hash, @@ -67,6 +66,7 @@ impl<'a> Validated<'a> { } } +#[must_use = "dropping a login creation attempt is likely a mistake"] pub struct Stored { login: History, } |
