Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ config = { version = "0.15", features = ["yaml"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
regex = "1.12"
rand = "0.8"
rand = "0.10"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking API changes not addressed

Bumping rand from 0.8 to 0.10 is a major version change with several breaking API changes, and the existing code in src-tauri/src/logging.rs:11-17 uses APIs that were removed or renamed in 0.10:

  1. rand::thread_rng no longer exists — replaced with rand::rng() (returns ThreadRng directly instead of wrapping it).
  2. rand::Rng trait was renamed to rand::RngExt (since rand_core::RngCore was renamed to rand_core::Rng).
  3. rand::distributions::Alphanumeric moved to rand::distr::Alphanumeric.

The current code:

use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
thread_rng()
    .sample_iter(&Alphanumeric)
    .take(8)
    .map(char::from)
    .collect()

Would need to become something like:

use rand::distr::Alphanumeric;
use rand::Rng;
rand::rng()
    .sample_iter(Alphanumeric)
    .take(8)
    .map(char::from)
    .collect()

This PR will fail to compile without updating the consuming code.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src-tauri/Cargo.toml
Line: 33

Comment:
**Breaking API changes not addressed**

Bumping `rand` from 0.8 to 0.10 is a major version change with several breaking API changes, and the existing code in `src-tauri/src/logging.rs:11-17` uses APIs that were removed or renamed in 0.10:

1. `rand::thread_rng` no longer exists — replaced with `rand::rng()` (returns `ThreadRng` directly instead of wrapping it).
2. `rand::Rng` trait was renamed to `rand::RngExt` (since `rand_core::RngCore` was renamed to `rand_core::Rng`).
3. `rand::distributions::Alphanumeric` moved to `rand::distr::Alphanumeric`.

The current code:
```rust
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
thread_rng()
    .sample_iter(&Alphanumeric)
    .take(8)
    .map(char::from)
    .collect()
```

Would need to become something like:
```rust
use rand::distr::Alphanumeric;
use rand::Rng;
rand::rng()
    .sample_iter(Alphanumeric)
    .take(8)
    .map(char::from)
    .collect()
```

This PR will fail to compile without updating the consuming code.

How can I resolve this? If you propose a fix, please make it concise.

clap = { version = "4", features = ["derive"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls"] }
Expand Down
Loading