forked from M-Labs/nac3
1
0
Fork 0

core/model: add SizeTModel::constant

This commit is contained in:
lyken 2024-07-26 13:37:04 +08:00
parent 679315acad
commit b304df8bcc
1 changed files with 8 additions and 0 deletions

View File

@ -90,3 +90,11 @@ impl<'ctx> Model<'ctx> for SizeTModel<'ctx> {
Ok(self.believe_value(value)) Ok(self.believe_value(value))
} }
} }
impl<'ctx> SizeTModel<'ctx> {
/// Create a constant value that inhabits this [`SizeTModel<'ctx>`].
#[must_use]
pub fn constant(&self, ctx: &'ctx Context, value: u64) -> SizeT<'ctx> {
int_constant(ctx, *self, value)
}
}