1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use syn::parse::{ParseStream, Result};
use syn::token::Eq;
use syn::{Ident, LitStr};

pub fn parse_eq_and_lit_str(name: Ident, input: ParseStream, help: &str) -> Result<LitStr> {
    if input.is_empty() {
        abort!(
            name.span(),
            "unexpected end of input, expected `=`";
            help = "The correct format looks like `#[diesel({})]`", help
        );
    }

    input.parse::<Eq>()?;
    input.parse::<LitStr>()
}