1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 18:09:22 +02:00

cleanup doc strings; prepare release

This commit is contained in:
Nikolay Kim
2018-04-16 09:30:59 -07:00
parent 58cc0dfbc5
commit 79818560b2
5 changed files with 20 additions and 19 deletions

View File

@ -61,7 +61,7 @@ impl HttpClientWriter {
self.buffer.take();
}
pub fn is_completed(&mut self) -> bool {
pub fn is_completed(&self) -> bool {
self.buffer.is_empty()
}

View File

@ -315,13 +315,18 @@ impl Default for FormConfig {
/// ```rust
/// extern crate bytes;
/// # extern crate actix_web;
/// use actix_web::{App, Result};
/// use actix_web::{http, App, Result};
///
/// /// extract text data from request
/// fn index(body: bytes::Bytes) -> Result<String> {
/// Ok(format!("Body {:?}!", body))
/// }
/// # fn main() {}
///
/// fn main() {
/// let app = App::new().resource(
/// "/index.html", |r|
/// r.method(http::Method::GET).with(index))
/// }
/// ```
impl<S: 'static> FromRequest<S> for Bytes {
type Config = PayloadConfig;
@ -354,13 +359,21 @@ impl<S: 'static> FromRequest<S> for Bytes {
///
/// ```rust
/// # extern crate actix_web;
/// use actix_web::{App, Result};
/// use actix_web::{http, App, Result};
///
/// /// extract text data from request
/// fn index(body: String) -> Result<String> {
/// Ok(format!("Body {}!", body))
/// }
/// # fn main() {}
///
/// fn main() {
/// let app = App::new().resource(
/// "/index.html", |r| {
/// r.method(http::Method::GET)
/// .with(index) // <- register handler with extractor params
/// .limit(4096); // <- limit size of the payload
/// })
/// }
/// ```
impl<S: 'static> FromRequest<S> for String {
type Config = PayloadConfig;