Skip to content

Commit 0027d96

Browse files
committed
chore: fmt
1 parent cf26d56 commit 0027d96

File tree

1 file changed

+5
-10
lines changed
  • extensions/ecc/sw-macros/src

1 file changed

+5
-10
lines changed

extensions/ecc/sw-macros/src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use proc_macro::TokenStream;
55
use quote::format_ident;
66
use syn::{
77
parse::{Parse, ParseStream},
8-
parse_macro_input, ExprPath, Token,
9-
LitStr,
8+
parse_macro_input, ExprPath, LitStr, Token,
109
};
1110

1211
/// This macro generates the code to setup the elliptic curve for a given modular type. Also it
@@ -71,11 +70,7 @@ pub fn sw_declare(input: TokenStream) -> TokenStream {
7170
macro_rules! create_extern_func {
7271
($name:ident) => {
7372
let $name = syn::Ident::new(
74-
&format!(
75-
"{}_{}",
76-
stringify!($name),
77-
struct_name_str
78-
),
73+
&format!("{}_{}", stringify!($name), struct_name_str),
7974
span.into(),
8075
);
8176
};
@@ -204,7 +199,7 @@ pub fn sw_declare(input: TokenStream) -> TokenStream {
204199
// (EcAdd only) p2 is (x2, y2), and x1 - x2 has to be non-zero to avoid division over zero in add.
205200
let p2 = [one.as_ref(), one.as_ref()].concat();
206201
let mut uninit: core::mem::MaybeUninit<[Self; 2]> = core::mem::MaybeUninit::uninit();
207-
202+
208203
unsafe { #sw_setup_extern_func(uninit.as_mut_ptr() as *mut core::ffi::c_void, p1.as_ptr(), p2.as_ptr()); }
209204
<#intmod_type as openvm_algebra_guest::IntMod>::set_up_once();
210205
true
@@ -425,7 +420,7 @@ impl Parse for SwDefine {
425420
fn parse(input: ParseStream) -> syn::Result<Self> {
426421
let items = input.parse_terminated(<LitStr as Parse>::parse, Token![,])?;
427422
Ok(Self {
428-
items: items.into_iter().map(|e| e.value()).collect()
423+
items: items.into_iter().map(|e| e.value()).collect(),
429424
})
430425
}
431426
}
@@ -499,7 +494,7 @@ pub fn sw_init(input: TokenStream) -> TokenStream {
499494
rs1 = In p1,
500495
rs2 = Const "x0" // will be parsed as 0 and therefore transpiled to SETUP_EC_DOUBLE
501496
);
502-
497+
503498

504499
}
505500
}

0 commit comments

Comments
 (0)