Skip to content

Commit 6015277

Browse files
committed
chore: upgrade rust version to 1.85.0
Address the new clippy warnings
1 parent 5a99b12 commit 6015277

File tree

10 files changed

+17
-23
lines changed

10 files changed

+17
-23
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ executors:
5252
environment:
5353
IMAGE_NAME: portalnetwork/trin
5454
docker:
55-
- image: cimg/rust:1.81.0
55+
- image: cimg/rust:1.85.0
5656
docker-nightly:
5757
docker:
5858
- image: rustlang/rust:nightly
@@ -153,7 +153,7 @@ jobs:
153153
resource_class: xlarge
154154
executor:
155155
name: rust/default
156-
tag: 1.81.0
156+
tag: 1.85.0
157157
environment:
158158
RUSTFLAGS: "-D warnings"
159159
RUST_LOG: "debug"
@@ -174,7 +174,7 @@ jobs:
174174
resource_class: xlarge
175175
executor:
176176
name: rust/default
177-
tag: 1.81.0
177+
tag: 1.85.0
178178
environment:
179179
RUSTFLAGS: "-D warnings"
180180
RUST_LOG: "debug"
@@ -211,7 +211,7 @@ jobs:
211211
resource_class: 2xlarge
212212
executor:
213213
name: rust/default
214-
tag: 1.81.0
214+
tag: 1.85.0
215215
environment:
216216
RUSTFLAGS: "-D warnings"
217217
RUST_LOG: "debug,html5ever=error,selectors=error,discv5::service=info"
@@ -231,7 +231,7 @@ jobs:
231231
check-workspace-crates:
232232
executor:
233233
name: rust/default
234-
tag: 1.81.0
234+
tag: 1.85.0
235235
# parallelism level should be set to the amount of simulators we have or greater
236236
# The reason for this is the CI code currently only supports 1 input at a time
237237
# if we have a parallelism level of 5 and 6 sims one test runner will get 2 test sims and fail

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keywords = ["ethereum", "portal-network"]
3232
license = "MIT"
3333
readme = "README.md"
3434
repository = "https://github.com/ethereum/trin"
35-
rust-version = "1.81.0"
35+
rust-version = "1.85.0"
3636
version = "0.2.1"
3737

3838
[workspace.dependencies]

bin/trin-execution/src/evm/block_executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub struct BlockExecutor<'a> {
6363
cumulative_gas_used: u64,
6464
}
6565

66-
impl<'a> BlockExecutor<'a> {
66+
impl BlockExecutor<'_> {
6767
pub fn new(database: EvmDB) -> Self {
6868
let state_database = State::builder()
6969
.with_database(database)

bin/trin-execution/src/trie_walker/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ impl<DB: TrieWalkerDb> Iterator for TrieWalker<DB> {
126126
type Item = TrieProof;
127127

128128
fn next(&mut self) -> Option<Self::Item> {
129-
let next_proof = match self.stack.pop() {
130-
Some(next_proof) => next_proof,
131-
None => return None,
132-
};
129+
let next_proof = self.stack.pop()?;
133130

134131
let TrieProof { path, proof } = &next_proof;
135132
let last_node = proof.last().expect("Proof is empty");

book/src/developers/quick_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ rustc --version
8383
You should see something like:
8484

8585
```bash
86-
rustc 1.81.0 (051478957 2024-07-21)
86+
rustc 1.85.0 (4d91de4e4 2025-02-17)
8787
```
8888

8989
Next, install the required dependencies:

crates/ethportal-api/src/types/ping_extensions/extensions/type_0.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ impl FromStr for ClientInfo {
165165
type Err = anyhow::Error;
166166

167167
fn from_str(string: &str) -> Result<Self, anyhow::Error> {
168-
ensure!(
169-
string.as_bytes().len() <= 200,
170-
"Client info string is too long"
171-
);
168+
ensure!(string.len() <= 200, "Client info string is too long");
172169
let parts: Vec<&str> = string.split('/').collect();
173170

174171
if parts.len() != 4 {

crates/ethportal-api/src/types/state_trie/nibbles.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ impl Encode for Nibbles {
5151
buf.push(0);
5252
self.nibbles
5353
.chunks_exact(2)
54-
.for_each(|x| buf.push(x[0] << 4 | x[1]));
54+
.for_each(|x| buf.push((x[0] << 4) | x[1]));
5555
} else {
5656
buf.push(0x10 | self.nibbles[0]);
5757
self.nibbles[1..]
5858
.chunks_exact(2)
59-
.for_each(|x| buf.push(x[0] << 4 | x[1]));
59+
.for_each(|x| buf.push((x[0] << 4) | x[1]));
6060
}
6161
}
6262

crates/validation/src/merkle/safe_arith.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
///
2-
/// Code sourced from:
3-
/// https://github.com/sigp/lighthouse/blob/bf533c8e42/consensus/safe_arith/src/lib.rs
1+
//!
2+
//! Code sourced from:
3+
//! https://github.com/sigp/lighthouse/blob/bf533c8e42/consensus/safe_arith/src/lib.rs
44
55
/// Extension trait for iterators, providing a safe replacement for `sum`.
66
pub trait SafeArithIter<T> {

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy.
33
# https://rust-lang.github.io/rustup/concepts/profiles.html
44
profile = "default"
5-
channel = "1.81.0"
5+
channel = "1.85.0"

testing/utp/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.81.0-bullseye AS builder
1+
FROM rust:1.85.0-bullseye AS builder
22

33
RUN apt-get update \
44
&& apt-get install clang -y \

0 commit comments

Comments
 (0)