mirror of
https://github.com/ntex-rs/ntex-extras.git
synced 2025-04-04 05:17:40 +03:00
clippy warnings
This commit is contained in:
parent
e58d49570f
commit
bdaacaaa08
8 changed files with 52 additions and 62 deletions
|
@ -35,16 +35,14 @@
|
|||
//! web::HttpResponse::Ok().finish()
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let app = web::App::new().wrap(IdentityService::new(
|
||||
//! // <- create identity middleware
|
||||
//! CookieIdentityPolicy::new(&[0; 32]) // <- create cookie identity policy
|
||||
//! .name("auth-cookie")
|
||||
//! .secure(false)))
|
||||
//! .service(web::resource("/index.html").to(index))
|
||||
//! .service(web::resource("/login.html").to(login))
|
||||
//! .service(web::resource("/logout.html").to(logout));
|
||||
//! }
|
||||
//! let app = web::App::new().wrap(IdentityService::new(
|
||||
//! // <- create identity middleware
|
||||
//! CookieIdentityPolicy::new(&[0; 32]) // <- create cookie identity policy
|
||||
//! .name("auth-cookie")
|
||||
//! .secure(false)))
|
||||
//! .service(web::resource("/index.html").to(index))
|
||||
//! .service(web::resource("/login.html").to(login))
|
||||
//! .service(web::resource("/logout.html").to(logout));
|
||||
//! ```
|
||||
use std::convert::Infallible;
|
||||
use std::future::Future;
|
||||
|
@ -206,14 +204,12 @@ pub trait IdentityPolicy<Err>: Sized + 'static {
|
|||
/// use ntex::web::App;
|
||||
/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
|
||||
///
|
||||
/// fn main() {
|
||||
/// let app = App::new().wrap(IdentityService::new(
|
||||
/// // <- create identity middleware
|
||||
/// CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
|
||||
/// .name("auth-cookie")
|
||||
/// .secure(false),
|
||||
/// ));
|
||||
/// }
|
||||
/// let app = App::new().wrap(IdentityService::new(
|
||||
/// // <- create identity middleware
|
||||
/// CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
|
||||
/// .name("auth-cookie")
|
||||
/// .secure(false),
|
||||
/// ));
|
||||
/// ```
|
||||
pub struct IdentityService<T, Err> {
|
||||
backend: Rc<T>,
|
||||
|
@ -487,16 +483,14 @@ impl<Err: ErrorRenderer> CookieIdentityInner<Err> {
|
|||
/// use ntex::web::App;
|
||||
/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
|
||||
///
|
||||
/// fn main() {
|
||||
/// let app = App::new().wrap(IdentityService::new(
|
||||
/// // <- create identity middleware
|
||||
/// CookieIdentityPolicy::new(&[0; 32]) // <- construct cookie policy
|
||||
/// .domain("www.rust-lang.org")
|
||||
/// .name("ntex-auth")
|
||||
/// .path("/")
|
||||
/// .secure(true),
|
||||
/// ));
|
||||
/// }
|
||||
/// let app = App::new().wrap(IdentityService::new(
|
||||
/// // <- create identity middleware
|
||||
/// CookieIdentityPolicy::new(&[0; 32]) // <- construct cookie policy
|
||||
/// .domain("www.rust-lang.org")
|
||||
/// .name("ntex-auth")
|
||||
/// .path("/")
|
||||
/// .secure(true),
|
||||
/// ));
|
||||
/// ```
|
||||
pub struct CookieIdentityPolicy<Err>(Rc<CookieIdentityInner<Err>>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue