Skip to content

Commit

Permalink
feat: bump to rust 2024 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasArrachea committed Mar 5, 2025
1 parent 3c5f411 commit 1bc8dd2
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ resolver = "2"

[workspace.package]
authors = ["Miden contributors"]
edition = "2021"
edition = "2024"
exclude = [".github/"]
homepage = "https://polygon.technology/polygon-miden"
license = "MIT"
readme = "README.md"
repository = "https://github.com/0xPolygonMiden/miden-node"
rust-version = "1.84"
rust-version = "1.85"
version = "0.8.0"

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion bin/faucet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async fn run_faucet_command(cli: Cli) -> anyhow::Result<()> {
let secret = SecretKey::with_rng(&mut get_rpo_random_coin(&mut rng));

let (account, account_seed) = create_basic_fungible_faucet(
rng.gen(),
rng.r#gen(),
(&root_block_header).try_into().context("failed to create anchor block")?,
TokenSymbol::try_from(token_symbol.as_str())
.context("failed to parse token symbol")?,
Expand Down
2 changes: 1 addition & 1 deletion bin/node/src/commands/genesis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn create_accounts(

let storage_mode = inputs.storage_mode.as_str().try_into()?;
let (account, account_seed) = create_basic_fungible_faucet(
rng.gen(),
rng.r#gen(),
AccountIdAnchor::PRE_GENESIS,
TokenSymbol::try_from(inputs.token_symbol.as_str())?,
inputs.decimals,
Expand Down
2 changes: 1 addition & 1 deletion crates/block-producer/src/batch_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl WorkerPool {
// Randomly fail batches at the configured rate.
//
// Note: Rng::gen rolls between [0, 1.0) for f32, so this works as expected.
let failed = rand::thread_rng().gen::<f32>() < self.failure_rate;
let failed = rand::thread_rng().r#gen::<f32>() < self.failure_rate;
let store = self.store.clone();

async move {
Expand Down
2 changes: 1 addition & 1 deletion crates/block-producer/src/block_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl BlockBuilder {

#[instrument(target = COMPONENT, name = "block_builder.inject_failure", skip_all, err)]
fn inject_failure<T>(&self, value: T) -> Result<T, BuildBlockError> {
let roll = rand::thread_rng().gen::<f64>();
let roll = rand::thread_rng().r#gen::<f64>();

Span::current().set_attribute("failure_rate", self.failure_rate);
Span::current().set_attribute("dice_roll", roll);
Expand Down
2 changes: 1 addition & 1 deletion crates/block-producer/src/test_utils/proven_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl MockProvenTxBuilder {
/// Generates 3 random, sequential transactions acting on the same account.
pub fn sequential() -> [AuthenticatedTransaction; 3] {
let mut rng = rand::thread_rng();
let mock_account: MockPrivateAccount<4> = rng.gen::<u32>().into();
let mock_account: MockPrivateAccount<4> = rng.r#gen::<u32>().into();

(0..3)
.map(|i| {
Expand Down
2 changes: 1 addition & 1 deletion crates/store/src/db/sql/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn schema_version(conn: &Connection) -> rusqlite::Result<usize> {

/// Auxiliary macro which substitutes `$src` token by `$dst` expression.
macro_rules! subst {
($src:tt, $dst:expr) => {
($src:tt, $dst:expr_2021) => {
$dst
};
}
Expand Down
2 changes: 1 addition & 1 deletion crates/utils/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rand::{Rng, RngCore};

/// Creates a new RPO Random Coin with random seed
pub fn get_rpo_random_coin<T: RngCore>(rng: &mut T) -> RpoRandomCoin {
let auth_seed: [u64; 4] = rng.gen();
let auth_seed: [u64; 4] = rng.r#gen();
let rng_seed = RpoDigest::from(auth_seed.map(Felt::new));

RpoRandomCoin::new(rng_seed.into())
Expand Down
2 changes: 1 addition & 1 deletion crates/utils/src/tracing/grpc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Creates a [`tracing::Span`] based on RPC service and method name.
macro_rules! rpc_span {
($service:expr, $method:expr) => {
($service:expr_2021, $method:expr_2021) => {
tracing::info_span!(
concat!($service, "/", $method),
rpc.service = $service,
Expand Down
4 changes: 2 additions & 2 deletions crates/utils/src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct LongVersion {

impl std::fmt::Display for LongVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let Self {
let &Self {
version,
mut sha,
mut branch,
Expand All @@ -39,7 +39,7 @@ impl std::fmt::Display for LongVersion {
debug,
} = self;

let dirty = match *dirty {
let dirty = match dirty {
"true" => "-dirty",
_ => "",
};
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.84"
channel = "1.85"
components = ["clippy", "rust-src", "rustfmt"]
profile = "minimal"

0 comments on commit 1bc8dd2

Please sign in to comment.