From 79818560b2dfe7b1578e730c10d49c32904b35ba Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 16 Apr 2018 09:30:59 -0700 Subject: [PATCH] cleanup doc strings; prepare release --- CHANGES.md | 2 +- Cargo.toml | 2 +- Makefile | 12 ------------ src/client/writer.rs | 2 +- src/extractor.rs | 21 +++++++++++++++++---- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1fae933ba..d81744762 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,7 @@ # Changes -## 0.5.2 (2018-04-xx) +## 0.5.2 (2018-04-16) * Allow to configure StaticFiles's CpuPool, via static method or env variable diff --git a/Cargo.toml b/Cargo.toml index 77b1b790e..f49cbf1d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web" -version = "0.5.1" +version = "0.5.2" authors = ["Nikolay Kim "] description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust." readme = "README.md" diff --git a/Makefile b/Makefile index fdc3cbbc0..47886bbea 100644 --- a/Makefile +++ b/Makefile @@ -10,17 +10,5 @@ build: test: build clippy cargo test $(CARGO_FLAGS) -skeptic: - USE_SKEPTIC=1 cargo test $(CARGO_FLAGS) - -# cd examples/word-count && python setup.py install && pytest -v tests - -clippy: - if $$CLIPPY; then cargo clippy $(CARGO_FLAGS); fi - doc: build cargo doc --no-deps $(CARGO_FLAGS) - cd guide; mdbook build -d ../target/doc/guide/; cd .. - -book: - cd guide; mdbook build -d ../target/doc/guide/; cd .. diff --git a/src/client/writer.rs b/src/client/writer.rs index d0300d59a..48e4cc711 100644 --- a/src/client/writer.rs +++ b/src/client/writer.rs @@ -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() } diff --git a/src/extractor.rs b/src/extractor.rs index 9415299b1..098b4d8f7 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -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 { /// Ok(format!("Body {:?}!", body)) /// } -/// # fn main() {} +/// +/// fn main() { +/// let app = App::new().resource( +/// "/index.html", |r| +/// r.method(http::Method::GET).with(index)) +/// } /// ``` impl FromRequest for Bytes { type Config = PayloadConfig; @@ -354,13 +359,21 @@ impl FromRequest 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 { /// 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 FromRequest for String { type Config = PayloadConfig;