Skip to content

Commit e264c21

Browse files
committed
docs: slight improvements
1 parent d86d35b commit e264c21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/routes/handler.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ pub struct PhantomParams<T>(PhantomData<T>);
8383
/// .route("bar", |state: u8| ok())
8484
/// // "baz" is unambiguous, as it has both `params` and `state` arguments
8585
/// .route("baz", |params: u8, state: u8| ok())
86+
/// // this is unambiguous, but a bit ugly.
87+
/// .route("qux", |params: u8, _: u8| ok())
8688
/// .with_state(3u8)
8789
/// # }
8890
/// ```
@@ -125,7 +127,7 @@ pub struct PhantomParams<T>(PhantomData<T>);
125127
/// However this still leaves the problem of "bar". There is no way to express
126128
/// "bar" unambiguously by reordering method invocations. In this case, you can
127129
/// use the [`Params`] and [`State`] wrapper structs to disambiguate the
128-
/// argument type.
130+
/// argument type. This should seem familiar to users of [`axum`].
129131
///
130132
/// ```
131133
/// # use ajj::{Router, Params, State};
@@ -148,7 +150,8 @@ pub struct PhantomParams<T>(PhantomData<T>);
148150
/// ```
149151
///
150152
/// 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.
152155
///
153156
/// ### Handler return type inference
154157
///

0 commit comments

Comments
 (0)