Skip to content

Commit 1f4b166

Browse files
Same formatting as in ceno
1 parent 64ebe8a commit 1f4b166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+861
-907
lines changed

circ_blocks/circ_fields/src/ext_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ff::{
2-
derive::subtle::{Choice, ConditionallySelectable, ConstantTimeEq},
32
Field,
3+
derive::subtle::{Choice, ConditionallySelectable, ConstantTimeEq},
44
};
55
use rand::RngCore;
66
use serde::{Deserialize, Serialize};

circ_blocks/circ_fields/src/ff_field.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@ macro_rules! def_field {
8585
fn from(mut i: i64) -> Self {
8686
let u = i.abs_diff(0);
8787
let neg = i < 0;
88-
if neg {
89-
-Ft::from(u)
90-
} else {
91-
Ft::from(u)
92-
}
88+
if neg { -Ft::from(u) } else { Ft::from(u) }
9389
}
9490
}
9591

@@ -100,7 +96,7 @@ macro_rules! def_field {
10096

10197
#[cfg(test)]
10298
mod test {
103-
use super::{Ft, FMOD};
99+
use super::{FMOD, Ft};
104100
use ff::Field;
105101
use rand::thread_rng;
106102
use rug::Integer;

circ_blocks/circ_fields/src/int_field.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
use datasize::DataSize;
55
use paste::paste;
66
use rug::{
7-
ops::{RemRounding, RemRoundingAssign},
87
Integer,
8+
ops::{RemRounding, RemRoundingAssign},
99
};
1010
use serde::{Deserialize, Serialize};
11-
use std::fmt::{self, Display, Formatter};
12-
use std::ops::Deref;
13-
use std::sync::Arc;
11+
use std::{
12+
fmt::{self, Display, Formatter},
13+
ops::Deref,
14+
sync::Arc,
15+
};
1416

1517
#[derive(PartialEq, Eq, Clone, Debug, PartialOrd, Ord, Hash, Serialize, Deserialize, DataSize)]
1618
pub struct IntField {

circ_blocks/circ_fields/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ pub mod moduli {
1414
}
1515

1616
use ext_field::FGoldilocksExt2;
17-
use ff_field::{FBls12381, FBn254, FCurve25519, FGoldilocks};
18-
use ff_field::{F_BLS12381_FMOD, F_BN254_FMOD, F_CURVE25519_FMOD, F_GOLDILOCKS_FMOD};
1917
use ff_field::{
20-
F_BLS12381_FMOD_ARC, F_BN254_FMOD_ARC, F_CURVE25519_FMOD_ARC, F_GOLDILOCKS_FMOD_ARC,
18+
F_BLS12381_FMOD, F_BLS12381_FMOD_ARC, F_BN254_FMOD, F_BN254_FMOD_ARC, F_CURVE25519_FMOD,
19+
F_CURVE25519_FMOD_ARC, F_GOLDILOCKS_FMOD, F_GOLDILOCKS_FMOD_ARC, FBls12381, FBn254,
20+
FCurve25519, FGoldilocks,
2121
};
2222
use int_field::IntField;
2323

@@ -26,9 +26,11 @@ use ff::Field;
2626
use paste::paste;
2727
use rug::Integer;
2828
use serde::{Deserialize, Serialize};
29-
use std::fmt::{self, Debug, Display, Formatter};
30-
use std::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
31-
use std::sync::Arc;
29+
use std::{
30+
fmt::{self, Debug, Display, Formatter},
31+
ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign},
32+
sync::Arc,
33+
};
3234

3335
// TODO: rework this using macros?
3436

circ_blocks/circ_fields/src/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::*;
2-
use rand::thread_rng;
3-
use rand::Rng;
2+
use rand::{Rng, thread_rng};
43
use rug::ops::RemRounding;
54

65
#[test]

circ_blocks/circ_hc/examples/u32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use circ_hc::{generate_hashcons_rc, Node as NodeTrait, Table as TableTrait};
1+
use circ_hc::{Node as NodeTrait, Table as TableTrait, generate_hashcons_rc};
22

33
generate_hashcons_rc!(u32);
44

circ_blocks/circ_hc/src/hashconsing/example_u8.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Warning: this file is generated from src/template.rs and generate_u8.zsh
2-
use hashconsing::*;
3-
use hashconsing::{HConsed, HashConsign};
2+
use hashconsing::{HConsed, HashConsign, *};
43

54
use crate::Id;
65

circ_blocks/circ_hc/src/hashconsing/macro_.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#[macro_export]
33
macro_rules! generate_hashcons_hashconsing {
44
($Op:ty) => {
5-
use hashconsing::*;
6-
use hashconsing::{HConsed, HashConsign};
5+
use hashconsing::{HConsed, HashConsign, *};
76

87
use $crate::Id;
98

circ_blocks/circ_hc/src/hashconsing/template.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use hashconsing::*;
2-
use hashconsing::{HConsed, HashConsign};
1+
use hashconsing::{HConsed, HashConsign, *};
32

43
use std::net::SocketAddrV6 as TemplateOp;
54

circ_blocks/circ_hc/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use std::cmp::{Eq, Ord, PartialEq, PartialOrd};
2-
use std::hash::Hash;
1+
use std::{
2+
cmp::{Eq, Ord, PartialEq, PartialOrd},
3+
hash::Hash,
4+
};
35

46
#[cfg(feature = "hashconsing")]
57
pub mod hashconsing;

0 commit comments

Comments
 (0)