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

Commit b10f24f

Browse files
committed
Add SendPropIdentifier::from_const
1 parent 0cd87a8 commit b10f24f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/demo/sendprop.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,12 @@ impl SendPropIdentifier {
11131113
SendPropIdentifier(hasher.finish())
11141114
}
11151115

1116+
/// Construct a SendPropIdentifier from a u64; like std::convert::From<u64> but marked as
1117+
/// const.
1118+
pub const fn from_const(raw: u64) -> Self {
1119+
SendPropIdentifier(raw)
1120+
}
1121+
11161122
/// This returns an option because only props known at compile time will return a name here
11171123
///
11181124
/// If you need to know the name of every property you need to keep a map yourself

0 commit comments

Comments
 (0)