From 32d7360433557d7f896ac3294e235d30540d5919 Mon Sep 17 00:00:00 2001 From: gcommer Date: Wed, 22 Jan 2025 22:27:16 -0500 Subject: [PATCH] Add SendPropIdentifier::from_const --- src/demo/sendprop.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/demo/sendprop.rs b/src/demo/sendprop.rs index 5ae4a97..9af7608 100644 --- a/src/demo/sendprop.rs +++ b/src/demo/sendprop.rs @@ -1113,6 +1113,12 @@ impl SendPropIdentifier { SendPropIdentifier(hasher.finish()) } + /// Construct a SendPropIdentifier from a u64; like std::convert::From 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