diff --git a/doc_examples/guide/dependency_injection/cookbook/project/Cargo.lock b/doc_examples/guide/dependency_injection/cookbook/project/Cargo.lock index d331a5c8e..30ac35319 100644 --- a/doc_examples/guide/dependency_injection/cookbook/project/Cargo.lock +++ b/doc_examples/guide/dependency_injection/cookbook/project/Cargo.lock @@ -415,6 +415,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -670,6 +671,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/buffered_body/project-custom_limit.snap b/doc_examples/guide/request_data/buffered_body/project-custom_limit.snap index 6c127a14e..47e7c1420 100644 --- a/doc_examples/guide/request_data/buffered_body/project-custom_limit.snap +++ b/doc_examples/guide/request_data/buffered_body/project-custom_limit.snap @@ -2,10 +2,11 @@ use pavex::blueprint::{constructor::Lifecycle, Blueprint}; use pavex::f; use pavex::request::body::BodySizeLimit; +use pavex::unit::ToByteUnit; pub fn body_size_limit() -> BodySizeLimit { BodySizeLimit::Enabled { - max_n_bytes: 10_485_760, // 10 MBs + max_size: 2.megabytes(), } } diff --git a/doc_examples/guide/request_data/buffered_body/project-granular_limits.snap b/doc_examples/guide/request_data/buffered_body/project-granular_limits.snap index 76291f200..2c56a4416 100644 --- a/doc_examples/guide/request_data/buffered_body/project-granular_limits.snap +++ b/doc_examples/guide/request_data/buffered_body/project-granular_limits.snap @@ -2,6 +2,7 @@ use pavex::blueprint::{constructor::Lifecycle, router::POST, Blueprint}; use pavex::f; use pavex::request::body::BodySizeLimit; +use pavex::unit::ToByteUnit; pub fn blueprint() -> Blueprint { let mut bp = Blueprint::new(); @@ -21,7 +22,7 @@ fn upload_bp() -> Blueprint { pub fn upload_size_limit() -> BodySizeLimit { BodySizeLimit::Enabled { - max_n_bytes: 1_073_741_824, // 1GB + max_size: 1.gigabytes(), } } ``` \ No newline at end of file diff --git a/doc_examples/guide/request_data/buffered_body/project/Cargo.lock b/doc_examples/guide/request_data/buffered_body/project/Cargo.lock index c429ace23..612c727fa 100644 --- a/doc_examples/guide/request_data/buffered_body/project/Cargo.lock +++ b/doc_examples/guide/request_data/buffered_body/project/Cargo.lock @@ -416,6 +416,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/buffered_body/project/src/custom_limit/blueprint.rs b/doc_examples/guide/request_data/buffered_body/project/src/custom_limit/blueprint.rs index e2cab8359..c0578f19b 100644 --- a/doc_examples/guide/request_data/buffered_body/project/src/custom_limit/blueprint.rs +++ b/doc_examples/guide/request_data/buffered_body/project/src/custom_limit/blueprint.rs @@ -1,10 +1,11 @@ use pavex::blueprint::{constructor::Lifecycle, Blueprint}; use pavex::f; use pavex::request::body::BodySizeLimit; +use pavex::unit::ToByteUnit; pub fn body_size_limit() -> BodySizeLimit { BodySizeLimit::Enabled { - max_n_bytes: 10_485_760, // 10 MBs + max_size: 2.megabytes(), } } diff --git a/doc_examples/guide/request_data/buffered_body/project/src/granular_limits/blueprint.rs b/doc_examples/guide/request_data/buffered_body/project/src/granular_limits/blueprint.rs index d39449991..b5e7be101 100644 --- a/doc_examples/guide/request_data/buffered_body/project/src/granular_limits/blueprint.rs +++ b/doc_examples/guide/request_data/buffered_body/project/src/granular_limits/blueprint.rs @@ -1,6 +1,7 @@ use pavex::blueprint::{constructor::Lifecycle, router::POST, Blueprint}; use pavex::f; use pavex::request::body::BodySizeLimit; +use pavex::unit::ToByteUnit; pub fn blueprint() -> Blueprint { let mut bp = Blueprint::new(); @@ -20,6 +21,6 @@ fn upload_bp() -> Blueprint { pub fn upload_size_limit() -> BodySizeLimit { BodySizeLimit::Enabled { - max_n_bytes: 1_073_741_824, // 1GB + max_size: 1.gigabytes(), } } diff --git a/doc_examples/guide/request_data/buffered_body/tutorial.yml b/doc_examples/guide/request_data/buffered_body/tutorial.yml index a5d43f76b..680306401 100644 --- a/doc_examples/guide/request_data/buffered_body/tutorial.yml +++ b/doc_examples/guide/request_data/buffered_body/tutorial.yml @@ -9,7 +9,7 @@ snippets: hl_lines: [ 4 ] - name: "custom_limit" source_path: "src/custom_limit/blueprint.rs" - ranges: [ "0..13", "19..20" ] + ranges: [ "0..14", "20..21" ] - name: "no_limit" source_path: "src/no_limit/blueprint.rs" ranges: [ "0..11", "17..18" ] diff --git a/doc_examples/guide/request_data/json/project/Cargo.lock b/doc_examples/guide/request_data/json/project/Cargo.lock index b724ea2a5..a4fcaa780 100644 --- a/doc_examples/guide/request_data/json/project/Cargo.lock +++ b/doc_examples/guide/request_data/json/project/Cargo.lock @@ -416,6 +416,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/path/project/Cargo.lock b/doc_examples/guide/request_data/path/project/Cargo.lock index b6568f1da..5e096317a 100644 --- a/doc_examples/guide/request_data/path/project/Cargo.lock +++ b/doc_examples/guide/request_data/path/project/Cargo.lock @@ -416,6 +416,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/query/project/Cargo.lock b/doc_examples/guide/request_data/query/project/Cargo.lock index 11003fbec..671814c46 100644 --- a/doc_examples/guide/request_data/query/project/Cargo.lock +++ b/doc_examples/guide/request_data/query/project/Cargo.lock @@ -394,6 +394,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/query_params/project/Cargo.lock b/doc_examples/guide/request_data/query_params/project/Cargo.lock index 3f70555d5..9eb45e8e8 100644 --- a/doc_examples/guide/request_data/query_params/project/Cargo.lock +++ b/doc_examples/guide/request_data/query_params/project/Cargo.lock @@ -394,6 +394,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/request_target/project/Cargo.lock b/doc_examples/guide/request_data/request_target/project/Cargo.lock index 3da5d926b..0093eca7b 100644 --- a/doc_examples/guide/request_data/request_target/project/Cargo.lock +++ b/doc_examples/guide/request_data/request_target/project/Cargo.lock @@ -394,6 +394,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -670,6 +671,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/doc_examples/guide/request_data/route_params/project/Cargo.lock b/doc_examples/guide/request_data/route_params/project/Cargo.lock index 04ccc5c90..809a84584 100644 --- a/doc_examples/guide/request_data/route_params/project/Cargo.lock +++ b/doc_examples/guide/request_data/route_params/project/Cargo.lock @@ -394,6 +394,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -671,6 +672,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/libs/Cargo.lock b/libs/Cargo.lock index e8140d6c8..90f05f046 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2068,6 +2068,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "ubyte", ] [[package]] @@ -3375,6 +3376,15 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "ucd-trie" version = "0.1.6" diff --git a/libs/pavex/Cargo.toml b/libs/pavex/Cargo.toml index d710191c6..3ad66049c 100644 --- a/libs/pavex/Cargo.toml +++ b/libs/pavex/Cargo.toml @@ -23,6 +23,7 @@ paste = "1" tracing = "0.1" http-body-util = "0.1" pin-project-lite = "0.2" +ubyte = { version = "0.10.4", features = ["serde"] } # Route parameters matchit = { git = "https://github.com/ibraheemdev/matchit", branch = "master" } diff --git a/libs/pavex/src/lib.rs b/libs/pavex/src/lib.rs index 4ec17ae96..9102abced 100644 --- a/libs/pavex/src/lib.rs +++ b/libs/pavex/src/lib.rs @@ -22,3 +22,4 @@ pub mod router; pub mod serialization; #[cfg(feature = "server")] pub mod server; +pub mod unit; diff --git a/libs/pavex/src/request/body/buffered_body.rs b/libs/pavex/src/request/body/buffered_body.rs index 5764d7df2..6231875d7 100644 --- a/libs/pavex/src/request/body/buffered_body.rs +++ b/libs/pavex/src/request/body/buffered_body.rs @@ -1,6 +1,7 @@ use bytes::Bytes; use http::header::CONTENT_LENGTH; use http_body_util::{BodyExt, Limited}; +use ubyte::ByteUnit; use crate::blueprint::constructor::{Constructor, Lifecycle}; use crate::blueprint::Blueprint; @@ -79,10 +80,11 @@ use super::{ /// use pavex::f; /// use pavex::blueprint::{Blueprint, constructor::Lifecycle}; /// use pavex::request::body::BodySizeLimit; +/// use pavex::unit::ToByteUnit; /// /// pub fn body_size_limit() -> BodySizeLimit { /// BodySizeLimit::Enabled { -/// max_n_bytes: 10_485_760 // 10 MBs +/// max_size: 10.megabytes() /// } /// } /// @@ -123,6 +125,7 @@ use super::{ /// use pavex::f; /// use pavex::blueprint::{Blueprint, constructor::Lifecycle, router::{GET, POST}}; /// use pavex::request::body::BodySizeLimit; +/// use pavex::unit::ToByteUnit; /// # pub fn home() -> String { todo!() } /// # pub fn upload() -> String { todo!() } /// @@ -145,7 +148,7 @@ use super::{ /// /// pub fn upload_size_limit() -> BodySizeLimit { /// BodySizeLimit::Enabled { -/// max_n_bytes: 1_073_741_824 // 1GB +/// max_size: 1.gigabytes() /// } /// } /// ``` @@ -166,8 +169,8 @@ impl BufferedBody { body_size_limit: BodySizeLimit, ) -> Result { match body_size_limit { - BodySizeLimit::Enabled { max_n_bytes } => { - Self::_extract_with_limit(request_head, body, max_n_bytes).await + BodySizeLimit::Enabled { max_size } => { + Self::_extract_with_limit(request_head, body, max_size).await } BodySizeLimit::Disabled => match body.collect().await { Ok(collected) => Ok(Self { @@ -194,7 +197,7 @@ impl BufferedBody { async fn _extract_with_limit( request_head: &RequestHead, body: B, - max_n_bytes: usize, + max_size: ByteUnit, ) -> Result where B: hyper::body::Body, @@ -207,7 +210,7 @@ impl BufferedBody { // Little shortcut to create a `SizeLimitExceeded` error. let limit_error = || SizeLimitExceeded { - max_n_bytes, + max_size, content_length, }; @@ -218,11 +221,14 @@ impl BufferedBody { // body reading process entirely rather than reading the body incrementally // until the limit is reached. if let Some(len) = content_length { - if len > max_n_bytes { + if len > max_size { return Err(limit_error().into()); } } + // We saturate to `usize::MAX` if we happen to be on a platform where + // `usize` is smaller than `u64` (e.g. 32-bit platforms). + let max_n_bytes = max_size.as_u64().try_into().unwrap_or(usize::MAX); // If the `Content-Length` header is missing, or if the expected size of the body // is smaller than the maximum size limit, we start buffering the body while keeping // track of the size limit. @@ -253,6 +259,7 @@ impl From for Bytes { #[cfg(test)] mod tests { use http::HeaderMap; + use ubyte::ToByteUnit; use crate::request::RequestHead; @@ -270,9 +277,13 @@ mod tests { #[tokio::test] async fn error_if_body_above_size_limit_without_content_length() { - let body = crate::response::body::raw::Full::new(Bytes::from(vec![0; 1000])); + let raw_body = vec![0; 1000]; + // Smaller than the size of the body. - let max_n_bytes = 100; + let max_n_bytes = 100.bytes(); + assert!(raw_body.len() > max_n_bytes.as_u64() as usize); + + let body = crate::response::body::raw::Full::new(Bytes::from(raw_body)); let err = BufferedBody::_extract_with_limit(&dummy_request_head(), body, max_n_bytes) .await .unwrap_err(); @@ -280,7 +291,9 @@ mod tests { insta::assert_debug_snapshot!(err, @r###" SizeLimitExceeded( SizeLimitExceeded { - max_n_bytes: 100, + max_size: ByteUnit( + 100, + ), content_length: None, }, ) @@ -296,21 +309,23 @@ mod tests { // Smaller than the value declared in the `Content-Length` header, // even though it's bigger than the actual size of the body. - let max_n_bytes = 100; + let max_size = 100.bytes(); let body = crate::response::body::raw::Full::new(Bytes::from(vec![0; 500])); request_head .headers .insert("Content-Length", "1000".parse().unwrap()); // Act - let err = BufferedBody::_extract_with_limit(&request_head, body, max_n_bytes) + let err = BufferedBody::_extract_with_limit(&request_head, body, max_size) .await .unwrap_err(); insta::assert_display_snapshot!(err, @"The request body is larger than the maximum size limit enforced by this server."); insta::assert_debug_snapshot!(err, @r###" SizeLimitExceeded( SizeLimitExceeded { - max_n_bytes: 100, + max_size: ByteUnit( + 100, + ), content_length: Some( 1000, ), diff --git a/libs/pavex/src/request/body/errors.rs b/libs/pavex/src/request/body/errors.rs index 7247b41a5..f6a8a9242 100644 --- a/libs/pavex/src/request/body/errors.rs +++ b/libs/pavex/src/request/body/errors.rs @@ -1,5 +1,6 @@ //! Errors that can occur while extracting information from the request body. use crate::response::Response; +use ubyte::ByteUnit; #[derive(Debug, thiserror::Error)] #[non_exhaustive] @@ -61,7 +62,7 @@ impl ExtractBufferedBodyError { /// The request body is larger than the maximum size limit enforced by this server. pub struct SizeLimitExceeded { /// The maximum size limit enforced by this server. - pub max_n_bytes: usize, + pub max_size: ByteUnit, /// The value of the `Content-Length` header for the request that breached the body /// size limit. /// diff --git a/libs/pavex/src/request/body/limit.rs b/libs/pavex/src/request/body/limit.rs index 48dda30db..b1c66217e 100644 --- a/libs/pavex/src/request/body/limit.rs +++ b/libs/pavex/src/request/body/limit.rs @@ -1,6 +1,8 @@ use crate::blueprint::constructor::{Constructor, Lifecycle}; use crate::blueprint::Blueprint; use crate::f; +use crate::unit::ByteUnit; +use ubyte::ToByteUnit; #[derive(Debug, Clone, Copy)] /// An upper limit on the size of incoming request bodies. @@ -10,7 +12,7 @@ pub enum BodySizeLimit { /// There is an active limit on the size of incoming request bodies. Enabled { /// The maximum size of incoming request bodies, in bytes. - max_n_bytes: usize, + max_size: ByteUnit, }, /// There is no limit on the size of incoming request bodies. Disabled, @@ -29,7 +31,7 @@ impl BodySizeLimit { impl Default for BodySizeLimit { fn default() -> Self { Self::Enabled { - max_n_bytes: 2_097_152, // 2 MBs + max_size: 2.megabytes(), } } } diff --git a/libs/pavex/src/unit.rs b/libs/pavex/src/unit.rs new file mode 100644 index 000000000..447677930 --- /dev/null +++ b/libs/pavex/src/unit.rs @@ -0,0 +1,2 @@ +//! Type-safe wrappers for working with measurable quantities (e.g. bytes). +pub use ubyte::{ByteUnit, ToByteUnit}; diff --git a/libs/pavex_macros/tests/fail/serde_conflict.stderr b/libs/pavex_macros/tests/fail/serde_conflict.stderr index 5494b8d2e..f4c6eb1d6 100644 --- a/libs/pavex_macros/tests/fail/serde_conflict.stderr +++ b/libs/pavex_macros/tests/fail/serde_conflict.stderr @@ -1,8 +1,8 @@ -error: `RouteParams` does not support `serde` attributes on the top-level struct or any of its fields. +error: `PathParams` does not support `serde` attributes on the top-level struct or any of its fields. - `RouteParams` takes care of deriving `serde::Serialize` and `serde::Deserialize` for your struct, using the default configuration. This allow Pavex to determine, at code-generation time, if the route params can be successfully extracted from the URL of incoming requests for the relevant routes (e.g. do you have a named field that doesn't map to any of the registered route parameters?). + `PathParams` takes care of deriving `serde::Serialize` and `serde::Deserialize` for your struct, using the default configuration. This allow Pavex to determine, at code-generation time, if the route params can be successfully extracted from the URL of incoming requests for the relevant routes (e.g. do you have a named field that doesn't map to any of the registered route parameters?). - If the default `serde` configuration won't work for your case, you should not derive `RouteParams` and opt instead for implementing `serde::Serialize` and `serde::Deserialize` directly for your struct (either manually or using a derive with custom attributes). + If the default `serde` configuration won't work for your case, you should not derive `PathParams` and opt instead for implementing `serde::Serialize` and `serde::Deserialize` directly for your struct (either manually or using a derive with custom attributes). Keep in mind that by going down this route you give up compile-time checking of the route parameters! --> tests/fail/serde_conflict.rs:3:1 | diff --git a/libs/pavex_macros/tests/fail/serde_conflict_after_route_params_without_attributes.stderr b/libs/pavex_macros/tests/fail/serde_conflict_after_route_params_without_attributes.stderr index ccf0c4c9f..d663e4343 100644 --- a/libs/pavex_macros/tests/fail/serde_conflict_after_route_params_without_attributes.stderr +++ b/libs/pavex_macros/tests/fail/serde_conflict_after_route_params_without_attributes.stderr @@ -1,8 +1,8 @@ error[E0119]: conflicting implementations of trait `Deserialize<'_>` for type `MyStruct` --> tests/fail/serde_conflict_after_route_params_without_attributes.rs:1:1 | -1 | #[pavex_macros::RouteParams] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` +1 | #[pavex_macros::PathParams] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` 2 | #[derive(serde::Deserialize)] | ------------------ first implementation here | diff --git a/libs/pavex_macros/tests/fail/serde_conflict_before_route_params_without_attributes.stderr b/libs/pavex_macros/tests/fail/serde_conflict_before_route_params_without_attributes.stderr index 1392362b2..3613fb445 100644 --- a/libs/pavex_macros/tests/fail/serde_conflict_before_route_params_without_attributes.stderr +++ b/libs/pavex_macros/tests/fail/serde_conflict_before_route_params_without_attributes.stderr @@ -3,7 +3,7 @@ error[E0119]: conflicting implementations of trait `Deserialize<'_>` for type `M | 1 | #[derive(serde::Deserialize)] | ------------------ first implementation here -2 | #[pavex_macros::RouteParams] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` +2 | #[pavex_macros::PathParams] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` | = note: this error originates in the derive macro `serde::Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)