diesel_derives/deprecated/
primary_key.rs
1use syn::parse::{Parse, ParseStream, Result};
2use syn::punctuated::Punctuated;
3use syn::token::Comma;
4use syn::{parenthesized, Ident};
5
6pub fn parse_primary_key(name: Ident, input: ParseStream) -> Result<Punctuated<Ident, Comma>> {
7 if input.is_empty() {
8 return Err(syn::Error::new(
9 name.span(),
10 "unexpected end of input, expected parentheses",
11 ));
12 }
13
14 let content;
15 parenthesized!(content in input);
16
17 content.parse_terminated(Ident::parse, syn::Token![,])
18}