@@ -83,6 +83,8 @@ pub struct PhantomParams<T>(PhantomData<T>);
83
83
/// .route("bar", |state: u8| ok())
84
84
/// // "baz" is unambiguous, as it has both `params` and `state` arguments
85
85
/// .route("baz", |params: u8, state: u8| ok())
86
+ /// // this is unambiguous, but a bit ugly.
87
+ /// .route("qux", |params: u8, _: u8| ok())
86
88
/// .with_state(3u8)
87
89
/// # }
88
90
/// ```
@@ -125,7 +127,7 @@ pub struct PhantomParams<T>(PhantomData<T>);
125
127
/// However this still leaves the problem of "bar". There is no way to express
126
128
/// "bar" unambiguously by reordering method invocations. In this case, you can
127
129
/// use the [`Params`] and [`State`] wrapper structs to disambiguate the
128
- /// argument type.
130
+ /// argument type. This should seem familiar to users of [`axum`].
129
131
///
130
132
/// ```
131
133
/// # use ajj::{Router, Params, State};
@@ -148,7 +150,8 @@ pub struct PhantomParams<T>(PhantomData<T>);
148
150
/// ```
149
151
///
150
152
/// These wrapper structs are available only when necessary, and may not be
151
- /// used when the `Handler` impl is unambiguous.
153
+ /// used when the `Handler` impl is unambiguous. Ambiguous handlers will always
154
+ /// result in a compilation error.
152
155
///
153
156
/// ### Handler return type inference
154
157
///
0 commit comments