Skip to content

Commit

Permalink
match improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Feb 7, 2024
1 parent 9d367af commit 471401f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pgrx-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,11 @@ fn impl_postgres_enum(ast: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
let enum_name = enum_ident.to_string();

// validate that we're only operating on an enum
let enum_data = match ast.data {
Data::Enum(e) => e,
_ => {
return Err(syn::Error::new(
ast.span(),
"#[derive(PostgresEnum)] can only be applied to enums",
))
}
let Data::Enum(enum_data) = ast.data else {
return Err(syn::Error::new(
ast.span(),
"#[derive(PostgresEnum)] can only be applied to enums",
));
};

let mut from_datum = proc_macro2::TokenStream::new();
Expand Down

0 comments on commit 471401f

Please sign in to comment.