Skip to content

Commit

Permalink
fix: apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptonemo committed Jan 8, 2025
1 parent a616f90 commit f662f9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
2 changes: 0 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
println!("cargo::rustc-check-cfg=cfg(nightly)");

fn is_compiled_for_64_bit_arch() -> bool {
cfg!(target_pointer_width = "64")
}
Expand Down
10 changes: 4 additions & 6 deletions fr32/src/padding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,14 @@ need to handle the potential bit-level misalignments:
// offset and num_bytes are based on the unpadded data, so
// if [0, 1, ..., 255] was the original unpadded data, offset 3 and len 4 would return
// [3, 4, 5, 6].
#[allow(clippy::multiple_bound_locations)]
pub fn write_unpadded<W: ?Sized>(
pub fn write_unpadded<W>(
source: &[u8],
target: &mut W,
offset: usize,
len: usize,
) -> io::Result<usize>
where
W: Write,
W: Write + Sized,
{
// Check that there's actually `len` raw data bytes encoded inside
// `source` starting at `offset`.
Expand Down Expand Up @@ -631,16 +630,15 @@ The reader will generally operate with bit precision, even if the padded
layout is byte-aligned (no extra bits) the data inside it isn't (since
we pad at the bit-level).
**/
#[allow(clippy::multiple_bound_locations)]
fn write_unpadded_aux<W: ?Sized>(
fn write_unpadded_aux<W>(
padding_map: &PaddingMap,
source: &[u8],
target: &mut W,
write_pos: usize,
max_write_size: usize,
) -> io::Result<usize>
where
W: Write,
W: Write + Sized,
{
// Position of the reader in the padded bit stream layout, deduced from
// the position of the writer (`write_pos`) in the raw data layout.
Expand Down
6 changes: 1 addition & 5 deletions storage-proofs-core/src/gadgets/insertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,12 @@ pub fn select<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
}

/// Takes two allocated numbers (`a`, `b`) and returns `a` if the condition is true, and `b` otherwise.
#[allow(clippy::multiple_bound_locations)]
pub fn pick<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
mut cs: CS,
condition: &Boolean,
a: &AllocatedNum<Scalar>,
b: &AllocatedNum<Scalar>,
) -> Result<AllocatedNum<Scalar>, SynthesisError>
where
CS: ConstraintSystem<Scalar>,
{
) -> Result<AllocatedNum<Scalar>, SynthesisError> {
let c = AllocatedNum::alloc(cs.namespace(|| "pick result"), || {
if condition
.get_value()
Expand Down
5 changes: 2 additions & 3 deletions storage-proofs-porep/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
fn main() {
println!("cargo::rustc-check-cfg=cfg(nightly)");
cfg_if_nightly()
}

Expand All @@ -8,6 +9,4 @@ fn cfg_if_nightly() {
}

#[rustversion::not(nightly)]
fn cfg_if_nightly() {
println!("cargo::rustc-check-cfg=cfg(nightly)");
}
fn cfg_if_nightly() {}

0 comments on commit f662f9b

Please sign in to comment.