Skip to content

Commit cccfabf

Browse files
ci: update rust-toolchain
1 parent bcdac5c commit cccfabf

File tree

6 files changed

+21
-16
lines changed

6 files changed

+21
-16
lines changed

fil-proofs-tooling/src/bin/benchy/stacked.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ where
151151
let pb = stacked::PublicInputs::<H::Domain, <Blake2sHasher as Hasher>::Domain> {
152152
replica_id,
153153
seed,
154-
tau: Some(tau.clone()),
154+
tau: Some(tau),
155155
k: Some(0),
156156
};
157157

filecoin-proofs/src/fr32.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -589,15 +589,20 @@ pub fn extract_bits_and_shift(
589589
let input = &input[..BitByte::from_bits(extraction_offset + num_bits).bytes_needed()];
590590

591591
// (2).
592-
let mut output = if new_offset < extraction_offset {
593-
// Shift right.
594-
shift_bits(input, extraction_offset - new_offset, false)
595-
} else if new_offset > extraction_offset {
596-
// Shift left.
597-
shift_bits(input, new_offset - extraction_offset, true)
598-
} else {
599-
// No shift needed, take the `input` as is.
600-
input.to_vec()
592+
use std::cmp::Ordering;
593+
let mut output = match new_offset.cmp(&extraction_offset) {
594+
Ordering::Less => {
595+
// Shift right.
596+
shift_bits(input, extraction_offset - new_offset, false)
597+
}
598+
Ordering::Greater => {
599+
// Shift left.
600+
shift_bits(input, new_offset - extraction_offset, true)
601+
}
602+
Ordering::Equal => {
603+
// No shift needed, take the `input` as is.
604+
input.to_vec()
605+
}
601606
};
602607

603608
// After the shift we may not need the last byte of the `output` (either

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-08-09
1+
nightly-2019-10-17

storage-proofs/src/circuit/metric/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
202202
AR: Into<String>,
203203
{
204204
let path = compute_path(&self.current_namespace, &annotation().into());
205-
self.aux.push(path.clone());
205+
self.aux.push(path);
206206

207207
Ok(Variable::new_unchecked(Index::Aux(self.aux.len() - 1)))
208208
}
@@ -214,7 +214,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
214214
AR: Into<String>,
215215
{
216216
let path = compute_path(&self.current_namespace, &annotation().into());
217-
self.inputs.push(path.clone());
217+
self.inputs.push(path);
218218

219219
Ok(Variable::new_unchecked(Index::Input(self.inputs.len() - 1)))
220220
}
@@ -245,7 +245,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
245245
{
246246
let name = name_fn().into();
247247
let path = compute_path(&self.current_namespace, &name);
248-
self.set_named_obj(path.clone(), NamedObject::Namespace);
248+
self.set_named_obj(path, NamedObject::Namespace);
249249
self.current_namespace.push(name);
250250
}
251251

storage-proofs/src/circuit/stacked/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<H: Hasher> InclusionPath<H> {
178178
) -> Result<(), SynthesisError> {
179179
let InclusionPath { auth_path, .. } = self;
180180

181-
let root = Root::from_allocated::<CS>(root.clone());
181+
let root = Root::from_allocated::<CS>(root);
182182
let value = Root::from_allocated::<CS>(leaf);
183183
PoRCircuit::<Bls12, H>::synthesize(cs, params, value, auth_path, root, true)
184184
}

storage-proofs/src/circuit/test/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl<E: Engine> ConstraintSystem<E> for TestConstraintSystem<E> {
399399
{
400400
let name = name_fn().into();
401401
let path = compute_path(&self.current_namespace, &name);
402-
self.set_named_obj(path.clone(), NamedObject::Namespace);
402+
self.set_named_obj(path, NamedObject::Namespace);
403403
self.current_namespace.push(name);
404404
}
405405

0 commit comments

Comments
 (0)