Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwebiii committed Aug 4, 2023
1 parent e7319e1 commit cb22f05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sunscreen_math_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ pub fn derive_barrett_config(input: proc_macro::TokenStream) -> TokenStream {
let input = parse_macro_input!(input);
let opts = Opts::from_derive_input(&input);

let Opts { num_limbs, modulus } = if opts.is_err() {
return quote! {compile_error!("You must specify #[barret_config(modulus = \"1234\", num_limbs = 2)]. Modulus requires either a hex value beginning in '0x' or decimal value. Limbs must be a positive an integer.")}.into();
let Opts { num_limbs, modulus } = if let Ok(o) = opts {
o
} else {
opts.unwrap()
return quote! {compile_error!("You must specify #[barret_config(modulus = \"1234\", num_limbs = 2)]. Modulus requires either a hex value beginning in '0x' or decimal value. Limbs must be a positive an integer.")}.into()
};

let modulus = match get_modulus(&modulus) {
Expand Down

0 comments on commit cb22f05

Please sign in to comment.