2017-08-29 03:14:59 +00:00
|
|
|
#![feature(plugin, decl_macro, custom_derive)]
|
2016-10-07 03:38:13 +00:00
|
|
|
#![plugin(rocket_codegen)]
|
|
|
|
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
2017-01-13 21:25:33 +00:00
|
|
|
use rocket::http::uri::SegmentError;
|
2016-10-07 03:38:13 +00:00
|
|
|
|
|
|
|
#[post("/<a>/<b..>")]
|
|
|
|
fn get(a: String, b: PathBuf) -> String {
|
|
|
|
format!("{}/{}", a, b.to_string_lossy())
|
|
|
|
}
|
|
|
|
|
2016-10-31 17:31:39 +00:00
|
|
|
#[post("/<a>/<b..>")]
|
2017-01-13 21:25:33 +00:00
|
|
|
fn get2(a: String, b: Result<PathBuf, SegmentError>) -> String {
|
2016-10-31 17:31:39 +00:00
|
|
|
format!("{}/{}", a, b.unwrap().to_string_lossy())
|
2016-10-07 03:38:13 +00:00
|
|
|
}
|
2016-10-31 17:31:39 +00:00
|
|
|
|
2017-09-10 08:19:38 +00:00
|
|
|
#[test]
|
2016-10-31 17:31:39 +00:00
|
|
|
fn main() { }
|