Skip to content

Commit

Permalink
🔧 Fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nwrenger committed Aug 4, 2024
1 parent 1cf6124 commit 6fd9f6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -260,6 +260,9 @@ enum Error {
#[metadata]
type Result<T> = std::result::Result<T, Error>;

#[metadata]
type S = String;

#[tokio::main]
async fn main() {
let app: Api<()> = Api::new()
Expand Down
3 changes: 2 additions & 1 deletion tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Huh<T> {
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<usize>,
Expand Down Expand Up @@ -69,6 +69,7 @@ enum Error {
InternalServerError,
}

// And types?!?
#[metadata]
type Result<T> = std::result::Result<T, Error>;

Expand Down

0 comments on commit 6fd9f6f

Please sign in to comment.