mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-04 00:32:39 +00:00
2f35b23514
This commit includes the following important API changes: * The `form` route parameter has been removed. * The `data` route parameter has been added. * Forms are not handled via the `data` parameter and `Form` type. * Removed the `data` parameter from `Request`. * Added `FromData` conversion trate and default implementation. * Added `DataOutcome` enum, which is the return type of `from_data`. * 'FromData' is now used to automatically derive the `data` parameter. * Moved `form` into `request` module. * Removed `Failure::new` in favor of direct value construction. This commit includes the following important package additions: * Added a 'raw_upload' example. * `manual_routes` example uses `Data` parameter. * Now building and running tests with `--all-features` flag. * All exmaples have been updated to latest API. * Now using upstream Tera. This commit includes the following important fixes: * Any valid ident is now allowed in single-parameter route parameters. * Lifetimes are now properly stripped in code generation. * `FromForm` derive now works on empty structs.
14 lines
426 B
Rust
14 lines
426 B
Rust
#![feature(plugin)]
|
|
#![plugin(rocket_codegen)]
|
|
|
|
#[get("/<name>")] //~ ERROR 'name' is declared
|
|
fn get(other: &str) -> &'static str { "hi" } //~ ERROR isn't in the function
|
|
|
|
#[get("/a?<r>")] //~ ERROR 'r' is declared
|
|
fn get1() -> &'static str { "hi" } //~ ERROR isn't in the function
|
|
|
|
#[get("/a", data = "<test>")] //~ ERROR 'test' is declared
|
|
fn get2() -> &'static str { "hi" } //~ ERROR isn't in the function
|
|
|
|
fn main() { }
|