mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rename #[parse(aliases)] to #[css(aliases)]
This commit is contained in:
parent
3fba02a0d6
commit
579cef6a69
4 changed files with 12 additions and 18 deletions
|
@ -6,6 +6,7 @@ use cg;
|
|||
use quote::Tokens;
|
||||
use syn::DeriveInput;
|
||||
use synstructure;
|
||||
use to_css::CssVariantAttrs;
|
||||
|
||||
pub fn derive(input: DeriveInput) -> Tokens {
|
||||
let name = &input.ident;
|
||||
|
@ -19,7 +20,7 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
"Parse is only supported for single-variant enums for now"
|
||||
);
|
||||
|
||||
let variant_attrs = cg::parse_variant_attrs::<ParseVariantAttrs>(variant);
|
||||
let variant_attrs = cg::parse_variant_attrs::<CssVariantAttrs>(variant);
|
||||
let identifier = cg::to_css_identifier(variant.ident.as_ref());
|
||||
let ident = &variant.ident;
|
||||
|
||||
|
@ -87,11 +88,3 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
#methods_impl
|
||||
}
|
||||
}
|
||||
|
||||
#[darling(attributes(parse), default)]
|
||||
#[derive(Default, FromVariant)]
|
||||
struct ParseVariantAttrs {
|
||||
/// The comma-separated list of aliases this variant should be aliased to at
|
||||
/// parse time.
|
||||
aliases: Option<String>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue