mirror of
https://github.com/actix/actix-web.git
synced 2025-01-05 14:58:44 +00:00
remove reference to master
This commit is contained in:
parent
81ac905c7b
commit
fd87eb59f8
3 changed files with 5 additions and 13 deletions
14
README.md
14
README.md
|
@ -20,7 +20,7 @@ Actix web is a simple, pragmatic and extremely fast web framework for Rust.
|
||||||
[CSRF](https://actix.github.io/actix-web/actix_web/middleware/csrf/index.html))
|
[CSRF](https://actix.github.io/actix-web/actix_web/middleware/csrf/index.html))
|
||||||
* Built on top of [Actix actor framework](https://github.com/actix/actix)
|
* Built on top of [Actix actor framework](https://github.com/actix/actix)
|
||||||
|
|
||||||
## Documentation
|
## Documentation & community resources
|
||||||
|
|
||||||
* [User Guide](http://actix.github.io/actix-web/guide/)
|
* [User Guide](http://actix.github.io/actix-web/guide/)
|
||||||
* [API Documentation (Development)](http://actix.github.io/actix-web/actix_web/)
|
* [API Documentation (Development)](http://actix.github.io/actix-web/actix_web/)
|
||||||
|
@ -31,26 +31,18 @@ Actix web is a simple, pragmatic and extremely fast web framework for Rust.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
At the moment all examples are based on the actix-web `master` branch.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
actix = "0.5"
|
|
||||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
|
||||||
```
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
extern crate actix_web;
|
extern crate actix_web;
|
||||||
use actix_web::{server, App, Path};
|
use actix_web::{server, App, Path};
|
||||||
|
|
||||||
fn index(info: Path<(String, u32)>) -> String {
|
fn index(info: Path<(u32, String)>) -> String {
|
||||||
format!("Hello {}! id:{}", info.0, info.1)
|
format!("Hello {}! id:{}", info.0, info.1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
server::new(
|
server::new(
|
||||||
|| App::new()
|
|| App::new()
|
||||||
.resource("/{name}/{id}/index.html", |r| r.with(index)))
|
.resource("/{id}/{name}/index.html", |r| r.with(index)))
|
||||||
.bind("127.0.0.1:8080").unwrap()
|
.bind("127.0.0.1:8080").unwrap()
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ contains the following:
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix = "0.5"
|
actix = "0.5"
|
||||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
actix-web = "0.5"
|
||||||
```
|
```
|
||||||
|
|
||||||
In order to implement a web server, we first need to create a request handler.
|
In order to implement a web server, we first need to create a request handler.
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub(crate) struct SharedBytes(
|
||||||
|
|
||||||
impl Drop for SharedBytes {
|
impl Drop for SharedBytes {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Some(ref pool) = self.1 {
|
if let Some(pool) = self.1.take() {
|
||||||
if let Some(bytes) = self.0.take() {
|
if let Some(bytes) = self.0.take() {
|
||||||
if Rc::strong_count(&bytes) == 1 {
|
if Rc::strong_count(&bytes) == 1 {
|
||||||
pool.release_bytes(bytes);
|
pool.release_bytes(bytes);
|
||||||
|
|
Loading…
Reference in a new issue