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/login/extract.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/login/extract.rs') diff --git a/src/login/extract.rs b/src/login/extract.rs index bda55cd..542f879 100644 --- a/src/login/extract.rs +++ b/src/login/extract.rs @@ -13,7 +13,7 @@ pub struct IdentityToken { } impl IdentityToken { - /// Creates a new, unpopulated identity token store. + // Creates a new, unpopulated identity token store. #[cfg(test)] pub fn new() -> Self { Self { @@ -21,17 +21,17 @@ impl IdentityToken { } } - /// Get the identity secret sent in the request, if any. If the identity - /// was not sent, or if it has previously been [clear]ed, then this will - /// return [None]. If the identity has previously been [set], then this - /// will return that secret, regardless of what the request originally - /// included. + // Get the identity secret sent in the request, if any. If the identity + // was not sent, or if it has previously been [clear]ed, then this will + // return [None]. If the identity has previously been [set], then this + // will return that secret, regardless of what the request originally + // included. pub fn secret(&self) -> Option<&str> { self.cookies.get(IDENTITY_COOKIE).map(Cookie::value) } - /// Positively set the identity secret, and ensure that it will be sent - /// back to the client when this extractor is included in a response. + // Positively set the identity secret, and ensure that it will be sent + // back to the client when this extractor is included in a response. pub fn set(self, secret: &str) -> Self { let identity_cookie = Cookie::build((IDENTITY_COOKIE, String::from(secret))) .http_only(true) @@ -43,8 +43,8 @@ impl IdentityToken { } } - /// Remove the identity secret and ensure that it will be cleared when this - /// extractor is included in a response. + // Remove the identity secret and ensure that it will be cleared when this + // extractor is included in a response. pub fn clear(self) -> Self { Self { cookies: self.cookies.remove(IDENTITY_COOKIE), -- cgit v1.2.3