diff options
| author | Fuwn <[email protected]> | 2024-04-10 09:32:15 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-04-10 09:32:15 +0000 |
| commit | e109360fc20f8e1496f5116ab6dd50978916f394 (patch) | |
| tree | a5ae575a971820a272fac5e29ce68523b85f5bf7 | |
| parent | feat(rossweisse): bump version (diff) | |
| download | windmark-e109360fc20f8e1496f5116ab6dd50978916f394.tar.xz windmark-e109360fc20f8e1496f5116ab6dd50978916f394.zip | |
chore(examples): update rossweisse example
| -rw-r--r-- | Cargo.toml | 10 | ||||
| -rw-r--r-- | rossweisse/src/implementations/router/fields.rs | 22 |
2 files changed, 20 insertions, 12 deletions
@@ -33,7 +33,13 @@ tokio-openssl = { version = "0.6.3", optional = true } async-std-openssl = { version = "0.6.3", optional = true } # Non-blocking I/O -tokio = { version = "1.26.0", default-features = false, features = ["rt-multi-thread", "sync", "net", "io-util", "macros"], optional = true } +tokio = { version = "1.26.0", default-features = false, features = [ + "rt-multi-thread", + "sync", + "net", + "io-util", + "macros", +], optional = true } async-trait = "0.1.68" async-std = { version = "1.12.0", features = ["attributes"], optional = true } @@ -50,4 +56,4 @@ tree_magic = { version = "0.2.3", optional = true } # MIME paste = "1.0.12" # Token Pasting [dev-dependencies] -rossweisse = { version = "0.0.2", path = "./rossweisse" } +rossweisse = { version = "0.0.3", path = "./rossweisse" } diff --git a/rossweisse/src/implementations/router/fields.rs b/rossweisse/src/implementations/router/fields.rs index 1280270..6d09ab4 100644 --- a/rossweisse/src/implementations/router/fields.rs +++ b/rossweisse/src/implementations/router/fields.rs @@ -25,17 +25,19 @@ pub fn fields(arguments: TokenStream, item: syn::ItemStruct) -> TokenStream { let router_identifier = item.ident; let (named_fields, has_fields) = match item.fields { syn::Fields::Named(fields) => (fields, true), - syn::Fields::Unit => ( - syn::FieldsNamed { - brace_token: syn::token::Brace::default(), - named: Default::default(), - }, - false, - ), - _ => panic!( - "`#[rossweisse::router]` can only be used on `struct`s with named \ + syn::Fields::Unit => + ( + syn::FieldsNamed { + brace_token: syn::token::Brace::default(), + named: Default::default(), + }, + false, + ), + _ => + panic!( + "`#[rossweisse::router]` can only be used on `struct`s with named \ fields or unit structs" - ), + ), }; let mut default_expressions = vec![]; let new_method_fields = named_fields.named.iter().map(|field| { |