mirror of https://github.com/rwf2/Rocket.git
Switch to UFCS in param.contains call.
This commit is contained in:
parent
05cf6b57c4
commit
43bfefc1b2
|
@ -107,7 +107,7 @@ impl<'s, 'a, 'c> Iterator for ParamIter<'s, 'a, 'c> {
|
||||||
if param.len() == 0 {
|
if param.len() == 0 {
|
||||||
self.ctxt.span_err(param_span, "Parameter names cannot be empty.");
|
self.ctxt.span_err(param_span, "Parameter names cannot be empty.");
|
||||||
None
|
None
|
||||||
} else if param.contains(|c: char| !c.is_alphanumeric()) {
|
} else if param.contains(char::is_alphanumeric) {
|
||||||
self.ctxt.span_err(param_span, "Parameters must be alphanumeric.");
|
self.ctxt.span_err(param_span, "Parameters must be alphanumeric.");
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
@ -206,6 +206,7 @@ impl<'a, 'c> RouteDecoratorExt for MetaItemParser<'a, 'c> {
|
||||||
});
|
});
|
||||||
|
|
||||||
let content_type = kv_pairs.get("content").and_then(|data| {
|
let content_type = kv_pairs.get("content").and_then(|data| {
|
||||||
|
debug!("Found data: {:?}", content_type);
|
||||||
if let Ok(ct) = ContentType::from_str(data.node) {
|
if let Ok(ct) = ContentType::from_str(data.node) {
|
||||||
if ct.is_ext() {
|
if ct.is_ext() {
|
||||||
let msg = format!("'{}' is not a known content-type", data.node);
|
let msg = format!("'{}' is not a known content-type", data.node);
|
||||||
|
@ -220,7 +221,6 @@ impl<'a, 'c> RouteDecoratorExt for MetaItemParser<'a, 'c> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
debug!("Found data: {:?}", content_type);
|
|
||||||
|
|
||||||
RouteParams {
|
RouteParams {
|
||||||
method: method,
|
method: method,
|
||||||
|
|
Loading…
Reference in New Issue