1
0
forked from M-Labs/nac3

core/model: add SizeTModel::constant

This commit is contained in:
lyken 2024-07-26 13:37:04 +08:00
parent 679315acad
commit b304df8bcc

View File

@ -90,3 +90,11 @@ impl<'ctx> Model<'ctx> for SizeTModel<'ctx> {
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)
}
}