Skip to content

Commit 40b39cf

Browse files
committed
Make clippy happy for 1.75
1 parent 25a8372 commit 40b39cf

File tree

5 files changed

+33
-35
lines changed

5 files changed

+33
-35
lines changed

kimchi/src/circuits/constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl<F: PrimeField, G: KimchiCurve<ScalarField = F>, OpeningProof: OpenProof<G>>
356356
}
357357

358358
// for public gates, only the left wire is toggled
359-
if row < self.cs.public && gate.coeffs.get(0) != Some(&F::one()) {
359+
if row < self.cs.public && gate.coeffs.first() != Some(&F::one()) {
360360
return Err(GateError::IncorrectPublic(row));
361361
}
362362

msm/src/fec/interpreter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ pub fn ec_add_circuit<
427427
let xr: Ff = slope * slope - xp - xq;
428428
let yr: Ff = slope * (xp - xr) - yp;
429429

430-
let two_bi: BigInt = TryFrom::try_from(2).unwrap();
430+
let two_bi: BigInt = BigInt::from(2);
431431

432432
let large_limb_size: F = From::from(1u128 << LIMB_BITSIZE_LARGE);
433433

msm/src/serialization/interpreter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ pub fn multiplication_circuit<
542542
) -> Ff {
543543
let coeff_result = chal * coeff_input;
544544

545-
let two_bi: BigInt = TryFrom::try_from(2).unwrap();
545+
let two_bi: BigInt = BigInt::from(2);
546546

547547
let large_limb_size: F = From::from(1u128 << LIMB_BITSIZE_LARGE);
548548

o1vm/src/cannon.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,35 @@ impl Meta {
307307
}
308308
}
309309

310+
pub const HINT_CLIENT_READ_FD: i32 = 3;
311+
pub const HINT_CLIENT_WRITE_FD: i32 = 4;
312+
pub const PREIMAGE_CLIENT_READ_FD: i32 = 5;
313+
pub const PREIMAGE_CLIENT_WRITE_FD: i32 = 6;
314+
315+
pub struct Preimage(Vec<u8>);
316+
317+
impl Preimage {
318+
pub fn create(v: Vec<u8>) -> Self {
319+
Preimage(v)
320+
}
321+
322+
pub fn get(self) -> Vec<u8> {
323+
self.0
324+
}
325+
}
326+
327+
pub struct Hint(Vec<u8>);
328+
329+
impl Hint {
330+
pub fn create(v: Vec<u8>) -> Self {
331+
Hint(v)
332+
}
333+
334+
pub fn get(self) -> Vec<u8> {
335+
self.0
336+
}
337+
}
338+
310339
#[cfg(test)]
311340
mod tests {
312341

@@ -480,32 +509,3 @@ mod tests {
480509
assert!(PreimageKey::from_str("0x01").is_err());
481510
}
482511
}
483-
484-
pub const HINT_CLIENT_READ_FD: i32 = 3;
485-
pub const HINT_CLIENT_WRITE_FD: i32 = 4;
486-
pub const PREIMAGE_CLIENT_READ_FD: i32 = 5;
487-
pub const PREIMAGE_CLIENT_WRITE_FD: i32 = 6;
488-
489-
pub struct Preimage(Vec<u8>);
490-
491-
impl Preimage {
492-
pub fn create(v: Vec<u8>) -> Self {
493-
Preimage(v)
494-
}
495-
496-
pub fn get(self) -> Vec<u8> {
497-
self.0
498-
}
499-
}
500-
501-
pub struct Hint(Vec<u8>);
502-
503-
impl Hint {
504-
pub fn create(v: Vec<u8>) -> Self {
505-
Hint(v)
506-
}
507-
508-
pub fn get(self) -> Vec<u8> {
509-
self.0
510-
}
511-
}

utils/src/field_helpers.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ pub trait FieldHelpers<F> {
8484
where
8585
F: PrimeField,
8686
{
87-
big.clone()
88-
.try_into()
89-
.map_err(|_| FieldHelpersError::DeserializeBytes)
87+
Ok(F::from(big.clone()))
9088
}
9189

9290
/// Serialize to bytes

0 commit comments

Comments
 (0)