Skip to content

Commit

Permalink
Update message and tun/linux code for latest dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Smet <[email protected]>
  • Loading branch information
LeeSmet committed Feb 11, 2025
1 parent ce3dcda commit f420a9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions mycelium/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,7 @@ impl MessageId {
fn new() -> Self {
let mut id = Self([0u8; 8]);

id.0.try_fill(&mut rand::thread_rng())
.expect("Can instantiate new ID from thread RNG generator; qed");
id.0.fill(&mut rand::rng());

id
}
Expand Down
5 changes: 4 additions & 1 deletion mycelium/src/tun/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ fn create_tun_interface(name: &str) -> Result<Tun, Box<dyn std::error::Error>> {
let tun = TunBuilder::new()
.name(name)
.mtu(LINK_MTU)
.queues(1)
.up()
.try_build()?;
.build()?
.pop()
.expect("Succesfully build tun interface has 1 queue");

Ok(tun)
}
Expand Down

0 comments on commit f420a9c

Please sign in to comment.