Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Add SendPropIdentifier::from_const #26

Merged
merged 1 commit into from
Feb 19, 2025
Merged
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
6 changes: 6 additions & 0 deletions src/demo/sendprop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,12 @@ impl SendPropIdentifier {
SendPropIdentifier(hasher.finish())
}

/// Construct a SendPropIdentifier from a u64; like std::convert::From<u64> but marked as
/// const.
pub const fn from_const(raw: u64) -> Self {
SendPropIdentifier(raw)
}

/// This returns an option because only props known at compile time will return a name here
///
/// If you need to know the name of every property you need to keep a map yourself
Expand Down
Loading