Skip to content

Commit 308e37a

Browse files
committed
migrate to rand 0.9
1 parent 18fde4f commit 308e37a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
jobs:
1515
build_n_test:
1616
strategy:
17+
fail-fast: false
1718
matrix:
1819
os: [ubuntu-latest, macos-latest, windows-latest]
1920

@@ -24,13 +25,20 @@ jobs:
2425
- name: rustfmt
2526
run: cargo fmt --all -- --check
2627
- name: check
28+
if: ${{ !cancelled() }}
2729
run: cargo check --verbose
2830
- name: clippy
31+
if: ${{ !cancelled() }}
2932
run: cargo clippy --all-targets --all-features -- -D warnings
3033
- name: Build
34+
if: ${{ !cancelled() }}
3135
run: cargo build --verbose
3236
- name: Run tests
37+
if: ${{ !cancelled() }}
3338
run: cargo test --verbose --all-features
39+
- name: Abort on error
40+
if: ${{ failure() }}
41+
run: echo "build_n_test failed" && false
3442

3543
semver:
3644
name: Check semver

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ env_logger = "0.11"
4141
hickory-proto = "0.24"
4242
log = "0.4"
4343
moka = { version = "0.12", features = ["future"] }
44-
rand = "0.8"
44+
rand = "0.9"
4545
tokio = { version = "1", features = ["rt-multi-thread"] }
4646

4747
[[example]]

examples/util/dns.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ use hickory_proto::{
77
use std::{net::IpAddr, str::FromStr};
88

99
pub fn build_dns_query(domain: &str, query_type: RecordType, used_by_tcp: bool) -> Result<Vec<u8>, String> {
10-
use rand::{rngs::StdRng, Rng, SeedableRng};
1110
let name = Name::from_str(domain).map_err(|e| e.to_string())?;
1211
let query = Query::query(name, query_type);
1312
let mut msg = Message::new();
1413
msg.add_query(query)
15-
.set_id(StdRng::from_entropy().gen())
14+
.set_id(rand::Rng::random::<u16>(&mut rand::rng()))
1615
.set_op_code(OpCode::Query)
1716
.set_message_type(MessageType::Query)
1817
.set_recursion_desired(true);

0 commit comments

Comments
 (0)