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

Merge pull request #26 from Gcommer/from_const

Add SendPropIdentifier::from_const
This commit is contained in:
Robin Appelman 2025-02-19 23:08:23 +01:00 committed by GitHub
commit e7451375c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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