1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

use forward_ready for service definitions

This commit is contained in:
Rob Ede
2021-03-22 05:18:59 +00:00
parent b0854ed144
commit 2254a429d4
9 changed files with 38 additions and 68 deletions

View File

@ -1,8 +1,6 @@
//! Cookie based sessions. See docs for [`CookieSession`].
use std::collections::HashMap;
use std::rc::Rc;
use std::task::{Context, Poll};
use std::{collections::HashMap, rc::Rc};
use actix_service::{Service, Transform};
use actix_web::cookie::{Cookie, CookieJar, Key, SameSite};
@ -326,9 +324,7 @@ where
type Error = S::Error;
type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.service.poll_ready(cx)
}
actix_service::forward_ready!(service);
/// On first request, a new session cookie is returned in response, regardless
/// of whether any session state is set. With subsequent requests, if the