Skip to content

Commit

Permalink
document deprecated redirect items
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Feb 19, 2023
1 parent b3ee747 commit deb75f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actix-web-lab/src/redirect.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! See [`Redirect`] for service/responder documentation.
#![allow(deprecated)]

use std::{borrow::Cow, future::ready};

use actix_web::{
Expand All @@ -11,6 +13,8 @@ use tracing::debug;

/// An HTTP service for redirecting one path to another path or URL.
///
/// _This feature has [graduated to Actix Web][graduated]. Further development will occur there._
///
/// Redirects are either [relative](Redirect::to) or [absolute](Redirect::to).
///
/// By default, the "307 Temporary Redirect" status is used when responding. See [this MDN
Expand All @@ -31,6 +35,7 @@ use tracing::debug;
/// ```
///
/// [mdn-redirects]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#permanent_redirections
/// [graduated]: https://docs.rs/actix-web/4/actix_web/web/struct.Redirect.html
#[deprecated(since = "0.19.0", note = "Type has graduated to Actix Web.")]
#[derive(Debug, Clone)]
pub struct Redirect {
Expand Down
4 changes: 4 additions & 0 deletions actix-web-lab/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ pub use crate::spa::Spa;

/// Create a relative or absolute redirect.
///
/// _This feature has [graduated to Actix Web][graduated]. Further development will occur there._
///
/// See [`Redirect`] docs for usage details.
///
/// # Examples
Expand All @@ -20,6 +22,8 @@ pub use crate::spa::Spa;
/// let app = App::new()
/// .service(web_lab::redirect("/one", "/two"));
/// ```
///
/// [graduated]: https://docs.rs/actix-web/4/actix_web/web/struct.Redirect.html
pub fn redirect(from: impl Into<Cow<'static, str>>, to: impl Into<Cow<'static, str>>) -> Redirect {
Redirect::new(from, to)
}
Expand Down

0 comments on commit deb75f7

Please sign in to comment.