Apply suggestions from code review

Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
David Pedersen
2022-02-14 15:06:39 +01:00
committed by GitHub
co-authored by Jonas Platte
parent 8ddf49501f
commit fcf8796b4b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ use super::sealed::Sealed;
/// ///
/// # Using `#[derive(TypedPath)]` /// # Using `#[derive(TypedPath)]`
/// ///
/// While `TypedPath` can be implemented manually its _highly_ recommended to derive it: /// While `TypedPath` can be implemented manually, it's _highly_ recommended to derive it:
/// ///
/// ``` /// ```
/// use serde::Deserialize; /// use serde::Deserialize;
@@ -84,7 +84,7 @@ use super::sealed::Sealed;
/// things, create links to known paths and have them verified statically. /// things, create links to known paths and have them verified statically.
/// - A [`FromRequest`] implementation compatible with [`RouterExt::typed_get`], /// - A [`FromRequest`] implementation compatible with [`RouterExt::typed_get`],
/// [`RouterExt::typed_post`], etc. This implementation uses [`Path`] and thus your struct must /// [`RouterExt::typed_post`], etc. This implementation uses [`Path`] and thus your struct must
/// also implement [`serde::Deserialize`], unless its a unit struct. /// also implement [`serde::Deserialize`], unless it's a unit struct.
/// ///
/// Additionally the macro will verify the captures in the path matches the fields of the struct. /// Additionally the macro will verify the captures in the path matches the fields of the struct.
/// For example this fails to compile since the struct doesn't have a `team_id` field: /// For example this fails to compile since the struct doesn't have a `team_id` field:
+1 -1
View File
@@ -14,7 +14,7 @@ pub(crate) fn expand(item_struct: ItemStruct) -> syn::Result<TokenStream> {
if !generics.params.is_empty() || generics.where_clause.is_some() { if !generics.params.is_empty() || generics.where_clause.is_some() {
return Err(syn::Error::new_spanned( return Err(syn::Error::new_spanned(
generics, generics,
"`#[derive(TypePath)]` doesn't support generics", "`#[derive(TypedPath)]` doesn't support generics",
)); ));
} }