Skip to content

Commit c626be3

Browse files
robertreamclaude
andcommitted
fix: relax Deserialize bound in ingress call to support all Error types
The upstream Deserialize trait now has an associated Error type. Relax the ingress `call()` and `decode_response()` bounds from requiring `Error = serde_json::Error` to accepting any error type convertible to RequestError via `From`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b48b029 commit c626be3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ingress.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,17 @@ impl<Res> Request<Res> {
437437
pub async fn call<E>(self, executor: &E) -> Result<Res, RequestError>
438438
where
439439
E: executor::Executor,
440-
Res: Deserialize<Error = serde_json::Error>,
440+
Res: Deserialize,
441+
RequestError: From<Res::Error>,
441442
{
442443
decode_response(executor.execute(self.request?).await?)
443444
}
444445
}
445446

446447
fn decode_response<Res>(response: executor::HttpResponse) -> Result<Res, RequestError>
447448
where
448-
Res: Deserialize<Error = serde_json::Error>,
449+
Res: Deserialize,
450+
RequestError: From<Res::Error>,
449451
{
450452
if response.status < 200 || response.status > 299 {
451453
let status = response.status;

0 commit comments

Comments
 (0)