1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

Add SendPropIdentifier::from_const

This commit is contained in:
gcommer 2025-01-22 22:27:16 -05:00 committed by Robin Appelman
commit 32d7360433

View file

@ -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