1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-27 07:19:04 +02:00

add feature annotations to docs

This commit is contained in:
Rob Ede
2022-07-31 23:40:09 +01:00
parent 19aa14a9d6
commit ea764b1d57
7 changed files with 16 additions and 0 deletions

View File

@ -311,6 +311,7 @@ impl HttpRequest {
/// Load request cookies.
#[cfg(feature = "cookies")]
#[cfg_attr(docsrs, doc(cfg(feature = "cookies")))]
pub fn cookies(&self) -> Result<Ref<'_, Vec<Cookie<'static>>>, CookieParseError> {
use actix_http::header::COOKIE;
@ -334,6 +335,7 @@ impl HttpRequest {
/// Return request cookie.
#[cfg(feature = "cookies")]
#[cfg_attr(docsrs, doc(cfg(feature = "cookies")))]
pub fn cookie(&self, name: &str) -> Option<Cookie<'static>> {
if let Ok(cookies) = self.cookies() {
for cookie in cookies.iter() {