From 697e90f291cec1bbd89965c2731f9481ec4507c4 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 25 Sep 2024 01:22:07 -0400 Subject: rustdoc comment for the (very limited) public API of the crate. This silences some `-Wclippy::pedantic` warning, and it's just a good thing to do. I've made the choice to have the docs comment face programmers, and to provide `hi --help` and `hi -h` content via Clap attributes instead of inferring it from the docs comment. Internal (private) "rustdoc" comments have been converted to regular comments until I learn how to write better rustdoc. --- src/repo/token.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/repo/token.rs') diff --git a/src/repo/token.rs b/src/repo/token.rs index 4eaa6ea..8276bea 100644 --- a/src/repo/token.rs +++ b/src/repo/token.rs @@ -17,8 +17,8 @@ impl<'c> Provider for Transaction<'c, Sqlite> { pub struct Tokens<'t>(&'t mut SqliteConnection); impl<'c> Tokens<'c> { - /// Issue a new token for an existing login. The issued_at timestamp will - /// be used to control expiry, until the token is actually used. + // Issue a new token for an existing login. The issued_at timestamp will + // be used to control expiry, until the token is actually used. pub async fn issue( &mut self, login: &Login, @@ -43,7 +43,7 @@ impl<'c> Tokens<'c> { Ok(secret) } - /// Revoke a token by its secret. + // Revoke a token by its secret. pub async fn revoke(&mut self, secret: &str) -> Result<(), sqlx::Error> { sqlx::query!( r#" @@ -60,8 +60,8 @@ impl<'c> Tokens<'c> { Ok(()) } - /// Expire and delete all tokens that haven't been used more recently than - /// ``expire_at``. + // Expire and delete all tokens that haven't been used more recently than + // `expire_at`. pub async fn expire(&mut self, expire_at: &DateTime) -> Result<(), sqlx::Error> { sqlx::query!( r#" @@ -77,9 +77,9 @@ impl<'c> Tokens<'c> { Ok(()) } - /// Validate a token by its secret, retrieving the associated Login record. - /// Will return [None] if the token is not valid. The token's last-used - /// timestamp will be set to `used_at`. + // Validate a token by its secret, retrieving the associated Login record. + // Will return [None] if the token is not valid. The token's last-used + // timestamp will be set to `used_at`. pub async fn validate( &mut self, secret: &str, -- cgit v1.2.3