Repository: actix/actix-web
File: src/extract.rs (Rust)

Code before:
//! Request extractors

use std::{
    future::Future,
    pin::Pin,
    task::{Context, Poll},
};

use actix_utils::future::{ready, Ready};
use futures_core::ready;

use crate::{dev::Payload, Error, HttpRequest};

/// A type that implements [`FromRequest`] is called an **extractor** and can extract data
/// from the request. Examples of types that implement this trait are [`Json`], [`Form`], [`Path`].
///
/// An extractor can be customized by injecting the corresponding configuration with one of:
///
/// - [`App::data()`](`crate::App::data`)
/// - [`App::app_data()`](`crate::App::app_data`)
/// - [`Scope::data()`](`crate::Scope::data`)
/// - [`Scope::app_data()`](`crate::Scope::app_data`)
/// - [`Resource::data()`](`crate::Resource::data`)
/// - [`Resource::app_data()`](`crate::Resource::app_data`)
///
/// Here are some built-in extractors and their corresponding configuration.
/// Please refer to the respective documentation for details.
///
/// | Extractor   | Configuration     |
/// |-------------|-------------------|
/// | [`Json`]    | [`JsonConfig`]    |
/// | [`Form`]    | [`FormConfig`]    |
/// | [`Path`]    | [`PathConfig`]    |
/// | [`Query`]   | [`QueryConfig`]   |
/// | [`Payload`] | [`PayloadConfig`] |
/// | [`String`]  | [`PayloadConfig`] |
/// | [`Bytes`]   | [`PayloadConfig`] |
///
/// [`Json`]: crate::web::Json
/// [`JsonConfig`]: crate::web::JsonConfig
/// [`Form`]: crate::web::Form
/// [`FormConfig`]: crate::web::FormConfig
/// [`Path`]: crate::web::Path
/// [`PathConfig`]: crate::web::PathConfig

Review comment (suggestion):
Given that `::data` has been marked as deprecated in favour of `::app_data` in the main branch it probably shouldn't be recommended here as an option.

Code after:
//! Request extractors

use std::{
    convert::Infallible,
    future::Future,
    pin::Pin,
    task::{Context, Poll},
};

use actix_http::http::{Method, Uri};
use actix_utils::future::{ok, Ready};
use futures_core::ready;

use crate::{dev::Payload, Error, HttpRequest};

/// A type that implements [`FromRequest`] is called an **extractor** and can extract data
/// from the request. Examples of types that implement this trait are [`Json`], [`Form`], [`Path`].
///
/// An extractor can be customized by injecting the corresponding configuration with one of:
///
/// - [`App::app_data()`](`crate::App::app_data`)
/// - [`Scope::app_data()`](`crate::Scope::app_data`)
/// - [`Resource::app_data()`](`crate::Resource::app_data`)
///
/// Here are some built-in extractors and their corresponding configuration.
/// Please refer to the respective documentation for details.
///
/// | Extractor   | Configuration     |
/// |-------------|-------------------|
/// | [`Json`]    | [`JsonConfig`]    |
/// | [`Form`]    | [`FormConfig`]    |
/// | [`Path`]    | [`PathConfig`]    |
/// | [`Query`]   | [`QueryConfig`]   |
/// | [`Payload`] | [`PayloadConfig`] |
/// | [`String`]  | [`PayloadConfig`] |
/// | [`Bytes`]   | [`PayloadConfig`] |
///
/// [`Json`]: crate::web::Json
/// [`JsonConfig`]: crate::web::JsonConfig
/// [`Form`]: crate::web::Form
/// [`FormConfig`]: crate::web::FormConfig
/// [`Path`]: crate::web::Path
/// [`PathConfig`]: crate::web::PathConfig
/// [`Query`]: crate::web::Query