2018-08-07 02:58:07 +00:00
|
|
|
#![feature(plugin, decl_macro)]
|
2016-10-07 03:38:13 +00:00
|
|
|
#![plugin(rocket_codegen)]
|
|
|
|
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
2018-08-13 07:46:31 +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() { }
|