1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-22 20:52:27 +00:00

rust can't think for itself

This commit is contained in:
Dominic 2020-04-29 21:00:06 +02:00
parent e013af8e18
commit cd7cf07318
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -1,6 +1,7 @@
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use std::cmp::min;
use syn::{
punctuated::Punctuated,
token::Comma,
@ -93,7 +94,7 @@ fn expand(tokens : TokenStream) -> Result<TokenStream2, Error>
};
}
for field in &fields.fields[2..]
for field in &fields.fields[min(2, fields.fields.len())..]
{
let field_ident = &field.0;
let field_ty = &field.1;