Skip to content

Commit eeebe93

Browse files
committed
update rocket section of the blog post
1 parent 4dd1038 commit eeebe93

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

posts/2020-07-16-Rust-1.45.0.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,23 @@ fn main() {
199199
```
200200

201201
Being able to use macros in more places is interesting, but there's another
202-
reason why many Rustaceans have been waiting for this feature for a long
203-
time. [Rocket](https://rocket.rs/) is a popular web framework for Rust.
204-
Initially released in December of 2016, it has often been described as one of
205-
the best things the Rust ecosystem has to offer. Here's the "hello world"
206-
example from its homepage:
202+
reason why many Rustaceans have been waiting for this feature for a long time:
203+
[Rocket](https://rocket.rs). Inititally released in December of 2016, Rocket is
204+
a popular web framework for Rust often described as one of the best things the
205+
Rust ecosystem has to offer. Here's the "hello world" example from its upcoming
206+
release:
207207

208208
```rust
209-
#![feature(proc_macro_hygiene, decl_macro)]
210-
211209
#[macro_use] extern crate rocket;
212210

213-
#[get("/hello/<name>/<age>")]
211+
#[get("/<name>/<age>")]
214212
fn hello(name: String, age: u8) -> String {
215213
format!("Hello, {} year old named {}!", age, name)
216214
}
217215

218-
fn main() {
219-
rocket::ignite().mount("/", routes![hello]).launch();
216+
#[launch]
217+
fn rocket() -> rocket::Rocket {
218+
rocket::ignite().mount("/hello", routes![hello])
220219
}
221220
```
222221

0 commit comments

Comments
 (0)