From 6fd9f6f148bd7308a792a1f8d877338b79fd0448 Mon Sep 17 00:00:00 2001 From: nwrenger Date: Sun, 4 Aug 2024 16:40:46 +0200 Subject: [PATCH] :wrench: Fixed docs --- README.md | 5 ++++- tests/main.rs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37f4710..d9b05ee 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ enum Alphabet { // Even tuples are supported #[metadata] -async fn get_alphabet(Path(r): Path<(Alphabet, String)>) -> Json<(Alphabet, String)> { +async fn get_alphabet(Path(r): Path<(Alphabet, S)>) -> Json<(Alphabet, S)> { Json(r) } @@ -260,6 +260,9 @@ enum Error { #[metadata] type Result = std::result::Result; +#[metadata] +type S = String; + #[tokio::main] async fn main() { let app: Api<()> = Api::new() diff --git a/tests/main.rs b/tests/main.rs index 9b8808c..8b07ef3 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -38,7 +38,7 @@ struct Huh { huh: T, } -// Even deep nested generics are supported and marking types as Custom +// Even deep nested generics are supported and tagging default rust types as Custom #[metadata(custom = [Result])] async fn add_root( Path(_): Path, @@ -69,6 +69,7 @@ enum Error { InternalServerError, } +// And types?!? #[metadata] type Result = std::result::Result;