Skip to content

Commit cb633d1

Browse files
jaslbkchrserban300
authored
Update deprecated usage (#937)
* Update bigint.rs * Apply suggestion from @bkchr * Apply rustc suggestions * Fix Test macOS-latest * Apply rustc suggestions * Fix more deprecation --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Serban Iorga <[email protected]>
1 parent 027731c commit cb633d1

File tree

10 files changed

+16
-13
lines changed

10 files changed

+16
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
- name: Workaround macOS Clang
5151
if: ${{ runner.os == 'macOS' }}
5252
run: |
53-
brew install llvm@20
54-
brew link llvm@20
53+
brew install llvm@15
54+
brew link llvm@15
5555
5656
- name: Rust Cache
5757
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0

bounded-collections/src/bounded_btree_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ where
213213
/// Gets a mutable iterator over the entries of the map, sorted by key.
214214
///
215215
/// See [`BTreeMap::iter_mut`] for more information.
216-
pub fn iter_mut(&mut self) -> alloc::collections::btree_map::IterMut<K, V> {
216+
pub fn iter_mut(&mut self) -> alloc::collections::btree_map::IterMut<'_, K, V> {
217217
self.0.iter_mut()
218218
}
219219

bounded-collections/src/bounded_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<T, S: Get<u32>> BoundedVec<T, S> {
641641

642642
impl<T, S> BoundedVec<T, S> {
643643
/// Return a [`BoundedSlice`] with the content and bound of [`Self`].
644-
pub fn as_bounded_slice(&self) -> BoundedSlice<T, S> {
644+
pub fn as_bounded_slice(&self) -> BoundedSlice<'_, T, S> {
645645
BoundedSlice(&self.0[..], PhantomData::default())
646646
}
647647
}

fixed-hash/benches/cmp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
//! Benchmarks for fixed-hash cmp implementation.
1010
11-
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
12-
11+
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
1312
use fixed_hash::construct_fixed_hash;
13+
use std::hint::black_box;
1414

1515
construct_fixed_hash! { pub struct H256(32); }
1616

keccak-hash/benches/keccak_256.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
use criterion::{black_box, criterion_group, criterion_main, Criterion};
9+
use criterion::{criterion_group, criterion_main, Criterion};
1010
use keccak_hash::keccak;
11+
use std::hint::black_box;
1112

1213
criterion_group!(keccak_256, keccak_256_with_empty_input, keccak_256_with_typical_input, keccak_256_with_large_input,);
1314
criterion_main!(keccak_256);

kvdb-rocksdb/benches/bench_read_perf.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ use std::{
2626
};
2727

2828
use alloc_counter::{count_alloc, AllocCounterSystem};
29-
use criterion::{black_box, criterion_group, criterion_main, Criterion};
29+
use criterion::{criterion_group, criterion_main, Criterion};
3030
use ethereum_types::H256;
3131
use rand::{distributions::Uniform, seq::SliceRandom, Rng};
32+
use std::hint::black_box;
3233

3334
use kvdb_rocksdb::{Database, DatabaseConfig};
3435

primitive-types/impls/serde/benches/impl_serde.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
//! cargo bench
1313
//! ```
1414
15-
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
15+
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
1616
use impl_serde::impl_uint_serde;
1717
use serde_derive::{Deserialize, Serialize};
18+
use std::hint::black_box;
1819
use uint::*;
1920

2021
mod input;

rlp/src/rlpin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl<'a> Rlp<'a> {
297297
self.at(index)?.as_list()
298298
}
299299

300-
pub fn decoder(&self) -> BasicDecoder {
300+
pub fn decoder(&self) -> BasicDecoder<'_> {
301301
BasicDecoder::new(self.bytes)
302302
}
303303

rlp/src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl RlpStream {
324324
self.finished_list = should_finish;
325325
}
326326

327-
pub fn encoder(&mut self) -> BasicEncoder {
327+
pub fn encoder(&mut self) -> BasicEncoder<'_> {
328328
BasicEncoder::new(self, self.start_pos)
329329
}
330330

uint/benches/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ impl U256 {
3030
}
3131
}
3232

33-
use criterion::{black_box, Bencher, BenchmarkId, Criterion};
33+
use criterion::{Bencher, BenchmarkId, Criterion};
3434
use num_bigint::BigUint;
3535
use rug::{integer::Order, Integer};
36-
use std::str::FromStr;
36+
use std::{hint::black_box, str::FromStr};
3737

3838
criterion_group!(
3939
bigint,

0 commit comments

Comments
 (0)