mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Easily convert typed paths into URIs (#790)
* Easily convert typed paths into URIs `#[derive(TypedPath)]` will now also generate `TryFrom<_> for Uri` for easily converting paths into URIs for use with `Redirect` and friends. Fixes https://github.com/tokio-rs/axum/issues/789 * Use a method on the `TypedPath` trait to convert to `Uri` * fix doc ref * Update changelogs
This commit is contained in:
@@ -29,7 +29,7 @@ pub(crate) fn expand(item_struct: ItemStruct) -> syn::Result<TokenStream> {
|
||||
let segments = parse_path(&path)?;
|
||||
expand_unnamed_fields(fields, ident, path, &segments)
|
||||
}
|
||||
syn::Fields::Unit => Ok(expand_unit_fields(ident, path)?),
|
||||
syn::Fields::Unit => expand_unit_fields(ident, path),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user