Skip to content

Commit

Permalink
feat(core/node): impl From<NodeNo> for u16
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Sep 27, 2023
1 parent 6aefa23 commit 524c1d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions elfo-core/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ use std::sync::atomic::{AtomicU16, Ordering};
#[cfg(feature = "unstable")]
pub use crate::addr::NodeNo;

// Temporary (?) conversion.
#[cfg(feature = "unstable")]
impl From<NodeNo> for u16 {
fn from(node_no: NodeNo) -> Self {
node_no.into_bits()
}
}

static NODE_NO: AtomicU16 = AtomicU16::new(0);

/// Returns the current `node_no`.
Expand Down

0 comments on commit 524c1d8

Please sign in to comment.