1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-06-07 14:20:42 +00:00

add dependencies to schema

This commit is contained in:
Dominic 2019-10-01 16:13:13 +02:00
parent d1c7ac5887
commit 3427fb4c6f
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
4 changed files with 141 additions and 50 deletions

View file

@ -27,14 +27,14 @@ rest_struct!{User {
username : String
}}
impl ResourceReadAll<Success<Vec<User>>> for Users
impl ResourceReadAll<Success<Vec<Option<User>>>> for Users
{
fn read_all(_state : &mut State) -> Success<Vec<User>>
fn read_all(_state : &mut State) -> Success<Vec<Option<User>>>
{
vec![Username().fake(), Username().fake()]
.into_iter()
.map(|username| User { username })
.collect::<Vec<User>>()
.map(|username| Some(User { username }))
.collect::<Vec<Option<User>>>()
.into()
}
}