Skip to content

Commit 4cf0013

Browse files
committed
Update axum to v0.8
1 parent e66b077 commit 4cf0013

File tree

7 files changed

+97
-173
lines changed

7 files changed

+97
-173
lines changed

Cargo.lock

Lines changed: 14 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ assert-json-diff = '2'
288288
async-channel = '1'
289289
async-trait = '0.1'
290290
asynchronous-codec = '0.7'
291-
axum = { version = '0.7' }
292-
axum-extra = { version = '0.9', features = ['typed-header', 'query'] }
291+
axum = { version = '0.8' }
292+
axum-extra = { version = '0.10', features = ['typed-header', 'query'] }
293293
base64 = '0.22'
294294
bincode = '1'
295295
bit_field = '0.10'
@@ -414,7 +414,10 @@ semver = '1'
414414
serde = { version = '1', features = ['derive', 'rc'] }
415415
serde-aux = '4'
416416
serde_json = { version = '1', features = ['preserve_order'] }
417-
serde_qs = { version = '0.13', features = ['axum'] }
417+
# TODO: check if serde_qs has merged axum v0.8 support
418+
# https://github.com/samscott89/serde_qs/pull/118
419+
# serde_qs = { version = '0.13', features = ['axum'] }
420+
serde_qs = { git = 'https://github.com/Atrox/serde_qs', rev = '2cfa3ee0af44ad8e78ed6bd6d0e7ac913f51f382', features = ['axum'] }
418421
serde_repr = '0.1'
419422
serde_with = '3'
420423
# TODO: replace serde_yaml with alternative, since it is deprecated:

http_api/src/error.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ struct EthErrorResponse<'error> {
280280
)]
281281
#[cfg(test)]
282282
mod tests {
283-
use axum::{extract::rejection::MissingJsonContentType, Error as AxumError};
283+
use axum::extract::rejection::MissingJsonContentType;
284284
use itertools::Itertools as _;
285285
use serde_json::{json, Result, Value};
286286
use test_case::test_case;
@@ -331,18 +331,4 @@ mod tests {
331331
],
332332
);
333333
}
334-
335-
// `axum_extra::extract::QueryRejection` and `axum::Error` duplicate error sources.
336-
// `axum::Error` has not been fixed in any version yet.
337-
// `axum::extract::rejection::QueryRejection` is even worse and harder to work around.
338-
#[test]
339-
fn error_sources_does_not_yield_triplicates_from_query_rejection() {
340-
let axum_error = AxumError::new("error");
341-
let error = Error::InvalidQuery(QueryRejection::FailedToDeserializeQueryString(axum_error));
342-
343-
assert_eq!(
344-
error.sources().map(ToString::to_string).collect_vec(),
345-
["invalid query string", "error"],
346-
);
347-
}
348334
}

0 commit comments

Comments
 (0)