-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from ngyn-rs/dev
v0.4.2 - Perf improvements + Swagger Crates
- Loading branch information
Showing
42 changed files
with
1,044 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: PR Workflow | ||
on: | ||
pull_request: | ||
types: ready_for_review | ||
push: | ||
branches: | ||
- dev | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use http::StatusCode; | ||
use proc_macro::TokenStream; | ||
use syn::{parse_macro_input, ItemFn, LitInt}; | ||
|
||
pub(crate) fn http_code_macro(args: TokenStream, raw_input: TokenStream) -> TokenStream { | ||
match syn::parse::<ItemFn>(raw_input.clone()) { | ||
Ok(_) => { | ||
let args = parse_macro_input!(args as LitInt); | ||
let code = args.base10_parse::<u16>().unwrap(); | ||
StatusCode::from_u16(code) | ||
.unwrap_or_else(|_| panic!("Invalid HTTP status code: {}", code)); | ||
} | ||
Err(err) => { | ||
panic!("failed to parse route: {}", err) | ||
} | ||
}; | ||
|
||
raw_input | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
pub mod check_macro; | ||
pub mod controller_macro; | ||
pub mod inject_macro; | ||
pub mod injectable_macro; | ||
pub mod route_macro; | ||
pub mod routes_macro; | ||
pub mod check; | ||
pub mod controller; | ||
pub mod http_code; | ||
pub mod inject; | ||
pub mod injectable; | ||
pub mod route; | ||
pub mod routes; |
File renamed without changes.
Oops, something went wrong.