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:
parent
e013af8e18
commit
cd7cf07318
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue