mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 14:57:01 +00:00
doc & ui-test for FromBody
This commit is contained in:
parent
e7e55514a2
commit
aa9fa0f457
6 changed files with 66 additions and 16 deletions
12
gotham_restful/tests/ui/from_body_enum.rs
Normal file
12
gotham_restful/tests/ui/from_body_enum.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
#[macro_use] extern crate gotham_restful;
|
||||
|
||||
#[derive(FromBody)]
|
||||
enum FromBodyEnum
|
||||
{
|
||||
SomeVariant(Vec<u8>),
|
||||
OtherVariant(String)
|
||||
}
|
||||
|
||||
fn main()
|
||||
{
|
||||
}
|
5
gotham_restful/tests/ui/from_body_enum.stderr
Normal file
5
gotham_restful/tests/ui/from_body_enum.stderr
Normal file
|
@ -0,0 +1,5 @@
|
|||
error: #[derive(FromBody)] only works for structs
|
||||
--> $DIR/from_body_enum.rs:4:1
|
||||
|
|
||||
4 | enum FromBodyEnum
|
||||
| ^^^^
|
Loading…
Add table
Add a link
Reference in a new issue