Skip to content

Commit

Permalink
cleanup api doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Nov 21, 2019
1 parent 53c5151 commit 1f0577f
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion awc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ use self::connect::{Connect, ConnectorWrapper};
/// An HTTP Client
///
/// ```rust
/// # use futures::future::{Future, lazy};
/// use actix_rt::System;
/// use awc::Client;
///
Expand Down
2 changes: 0 additions & 2 deletions awc/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const HTTPS_ENCODING: &str = "gzip, deflate";
/// builder-like pattern.
///
/// ```rust
/// use futures::future::{Future, lazy};
/// use actix_rt::System;
///
/// fn main() {
Expand Down Expand Up @@ -310,7 +309,6 @@ impl ClientRequest {
///
/// ```rust
/// # use actix_rt::System;
/// # use futures::future::{lazy, Future};
/// fn main() {
/// System::new("test").block_on(async {
/// awc::Client::new().get("https://www.rust-lang.org")
Expand Down
2 changes: 0 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ where
///
/// ```rust
/// use actix_service::Service;
/// # use futures::Future;
/// use actix_web::{middleware, web, App};
/// use actix_web::http::{header::CONTENT_TYPE, HeaderValue};
///
Expand Down Expand Up @@ -402,7 +401,6 @@ where
///
/// ```rust
/// use actix_service::Service;
/// # use futures::Future;
/// use actix_web::{web, App};
/// use actix_web::http::{header::CONTENT_TYPE, HeaderValue};
///
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ pub mod client {
//! An HTTP Client
//!
//! ```rust
//! # use futures::future::{Future, lazy};
//! use actix_rt::System;
//! use actix_web::client::Client;
//!
Expand Down
3 changes: 0 additions & 3 deletions src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ where
///
/// ```rust
/// use actix_web::*;
/// use futures::future::{ok, Future};
///
/// async fn index(req: HttpRequest) -> Result<HttpResponse, Error> {
/// Ok(HttpResponse::Ok().finish())
Expand All @@ -257,7 +256,6 @@ where
///
/// ```rust
/// # use actix_web::*;
/// # use futures::future::Future;
/// # async fn index(req: HttpRequest) -> Result<HttpResponse, Error> {
/// # unimplemented!()
/// # }
Expand Down Expand Up @@ -326,7 +324,6 @@ where
///
/// ```rust
/// use actix_service::Service;
/// # use futures::Future;
/// use actix_web::{web, App};
/// use actix_web::http::{header::CONTENT_TYPE, HeaderValue};
///
Expand Down
1 change: 0 additions & 1 deletion src/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ impl<T: Responder> Future for CustomResponderFut<T> {
/// Combines two different responder types into a single type
///
/// ```rust
/// # use futures::future::{ok, Future};
/// use actix_web::{Either, Error, HttpResponse};
///
/// type RegisterResult = Either<HttpResponse, Result<HttpResponse, Error>>;
Expand Down
2 changes: 0 additions & 2 deletions src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ impl Route {
/// This method has to be used if your handler function returns `impl Future<>`
///
/// ```rust
/// # use futures::future::ok;
/// use actix_web::{web, App, Error};
/// use futures::Future;
/// use serde_derive::Deserialize;
///
/// #[derive(Deserialize)]
Expand Down
1 change: 0 additions & 1 deletion src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ where
///
/// ```rust
/// use actix_service::Service;
/// # use futures::Future;
/// use actix_web::{web, App};
/// use actix_web::http::{header::CONTENT_TYPE, HeaderValue};
///
Expand Down
5 changes: 2 additions & 3 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,10 @@ impl WebService {
/// Add match guard to a web service.
///
/// ```rust
/// use futures::future::{ok, Ready};
/// use actix_web::{web, guard, dev, App, Error, HttpResponse};
///
/// fn index(req: dev::ServiceRequest) -> Ready<Result<dev::ServiceResponse, Error>> {
/// ok(req.into_response(HttpResponse::Ok().finish()))
/// async fn index(req: dev::ServiceRequest) -> Result<dev::ServiceResponse, Error> {
/// Ok(req.into_response(HttpResponse::Ok().finish()))
/// }
///
/// fn main() {
Expand Down
7 changes: 2 additions & 5 deletions src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ where
/// Create a new route and add async handler.
///
/// ```rust
/// # use futures::future::{ok, Future};
/// use actix_web::{web, App, HttpResponse, Error};
///
/// async fn index() -> Result<HttpResponse, Error> {
Expand All @@ -278,12 +277,10 @@ where
/// Create raw service for a specific path.
///
/// ```rust
/// # extern crate actix_web;
/// use futures::future::{ok, Ready};
/// use actix_web::{dev, web, guard, App, Error, HttpResponse};
///
/// fn my_service(req: dev::ServiceRequest) -> Ready<Result<dev::ServiceResponse, Error>> {
/// ok(req.into_response(HttpResponse::Ok().finish()))
/// async fn my_service(req: dev::ServiceRequest) -> Result<dev::ServiceResponse, Error> {
/// Ok(req.into_response(HttpResponse::Ok().finish()))
/// }
///
/// fn main() {
Expand Down

0 comments on commit 1f0577f

Please sign in to comment.