Skip to content

Commit 6342abf

Browse files
committed
chore: fix lint
1 parent cf26d56 commit 6342abf

15 files changed

+23
-36
lines changed

examples/algebra/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ num-bigint = { version = "0.4.6", features = ["serde"] }
1717

1818
[features]
1919
default = []
20+
21+
# remove this if copying example outside of monorepo
22+
[patch."https://github.com/openvm-org/openvm.git"]
23+
openvm = { path = "../../crates/toolchain/openvm" }
24+
openvm-algebra-guest = { path = "../../extensions/algebra/guest" }

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
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" }
33
openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { }
5-
openvm_ecc_guest::te_macros::te_init! { }
4+
openvm_ecc_guest::sw_macros::sw_init! {}

0 commit comments

Comments
 (0)