mirror of https://github.com/linkerd/linkerd2.git
proxy: Remove try_bind_route! macro (#915)
The macro is now only used once, so it seems clearer just to inline the logic.
This commit is contained in:
parent
0431193e94
commit
76ca32297e
|
@ -104,15 +104,6 @@ where T: Recognize
|
|||
}
|
||||
}
|
||||
|
||||
macro_rules! try_bind_route {
|
||||
( $bind:expr ) => {
|
||||
match $bind {
|
||||
Ok(svc) => svc,
|
||||
Err(e) => return ResponseFuture { state: State::RouteError(e) },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Service for Router<T>
|
||||
where T: Recognize,
|
||||
{
|
||||
|
@ -157,7 +148,11 @@ where T: Recognize,
|
|||
}
|
||||
|
||||
// Bind a new route, send the request on the route, and cache the route.
|
||||
let mut service = try_bind_route!(inner.recognize.bind_service(&key));
|
||||
let mut service = match inner.recognize.bind_service(&key) {
|
||||
Ok(svc) => svc,
|
||||
Err(e) => return ResponseFuture { state: State::RouteError(e) },
|
||||
};
|
||||
|
||||
let response = service.call(request);
|
||||
inner.routes.insert(key, service);
|
||||
ResponseFuture::new(response)
|
||||
|
|
Loading…
Reference in New Issue