Skip to content

Commit 69ca5ca

Browse files
build(deps): upgrade getrandom to v0.3
1 parent 164fde0 commit 69ca5ca

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

Cargo.lock

Lines changed: 29 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ all-features = true
1818
pnet_packet = "0.35"
1919
socket2 = { version = "0.5.1", features = ["all"] }
2020

21-
getrandom = "0.2"
21+
getrandom = "0.3.1"
2222
tokio = { version = "1.15", features = ["net", "sync", "rt"] }
2323

2424
# weak

examples/raw_ping.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async fn main() {
2828
tokio::spawn(async move {
2929
for addr in [localhost_v4, one_one_one_one_v4, not_answering_v4] {
3030
let mut payload = [0; 256];
31-
getrandom::getrandom(&mut payload).unwrap();
31+
getrandom::fill(&mut payload).unwrap();
3232

3333
let packet = EchoRequestPacket::new(1, 1, &payload);
3434
println!("Send ICMP v4 ping to {}", addr);
@@ -44,7 +44,7 @@ async fn main() {
4444
tokio::spawn(async move {
4545
for addr in [localhost_v6, one_one_one_one_v6] {
4646
let mut payload = [0; 256];
47-
getrandom::getrandom(&mut payload).unwrap();
47+
getrandom::fill(&mut payload).unwrap();
4848

4949
let packet = EchoRequestPacket::new(1, 1, &payload);
5050
println!("Send ICMP v6 ping to {}", addr);

src/pinger.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<V: IpVersion> Pinger<V> {
7474
let raw_blocking = RawBlockingPinger::new()?;
7575

7676
let mut identifier = [0; 2];
77-
getrandom::getrandom(&mut identifier).expect("run getrandom");
77+
getrandom::fill(&mut identifier).expect("run getrandom");
7878
let identifier = u16::from_ne_bytes(identifier);
7979

8080
let (sender, mut receiver) = mpsc::unbounded_channel();
@@ -296,7 +296,7 @@ impl<V: IpVersion, I: Iterator<Item = V>> MeasureManyStream<'_, V, I> {
296296
while let Some(&addr) = self.send_queue.peek() {
297297
let mut payload = [0; 64];
298298
#[cfg(feature = "strong")]
299-
getrandom::getrandom(&mut payload).expect("generate random payload");
299+
getrandom::fill(&mut payload).expect("generate random payload");
300300
#[cfg(not(feature = "strong"))]
301301
{
302302
let now = Instant::now().encode();

0 commit comments

Comments
 (0)