Renamed to 'data' to 'content_type'.

This commit is contained in:
Sergio Benitez 2016-08-22 19:21:59 -07:00
parent 8adf9f7c46
commit c8eef33820
1 changed files with 5 additions and 5 deletions

View File

@ -122,7 +122,7 @@ pub struct RouteParams {
pub method: Spanned<Method>, pub method: Spanned<Method>,
pub path: KVSpanned<String>, pub path: KVSpanned<String>,
pub form: Option<KVSpanned<String>>, pub form: Option<KVSpanned<String>>,
pub data: Option<KVSpanned<String>>, pub content_type: Option<KVSpanned<String>>,
} }
pub trait RouteDecoratorExt { pub trait RouteDecoratorExt {
@ -173,7 +173,7 @@ impl<'a, 'c> RouteDecoratorExt for MetaItemParser<'a, 'c> {
// Now grab all of the required and optional parameters. // Now grab all of the required and optional parameters.
let req: [&'static str; 1] = ["path"]; let req: [&'static str; 1] = ["path"];
let opt: [&'static str; 2] = ["form", "data"]; let opt: [&'static str; 2] = ["form", "content"];
let kv_pairs = get_key_values(self.ctxt, self.meta_item.span, let kv_pairs = get_key_values(self.ctxt, self.meta_item.span,
&req, &opt, kv_params); &req, &opt, kv_params);
@ -205,17 +205,17 @@ impl<'a, 'c> RouteDecoratorExt for MetaItemParser<'a, 'c> {
Some(f.clone().map(String::from)) Some(f.clone().map(String::from))
}); });
let data = kv_pairs.get("data").and_then(|data| { let content_type = kv_pairs.get("content").and_then(|data| {
Some(data.clone().map(String::from)) Some(data.clone().map(String::from))
}); });
debug!("Found data: {:?}", data); debug!("Found data: {:?}", content_type);
RouteParams { RouteParams {
method: method, method: method,
path: path, path: path,
form: form, form: form,
data: data content_type: content_type,
} }
} }