From aa94e0c8a4a296ba54eae757da6c17c183fad4d2 Mon Sep 17 00:00:00 2001 From: lyken Date: Thu, 13 Jun 2024 15:43:46 +0800 Subject: [PATCH] core: remove pub & add From for u32 --- nac3core/src/typecheck/typedef/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nac3core/src/typecheck/typedef/mod.rs b/nac3core/src/typecheck/typedef/mod.rs index 6489817a..ee06cabd 100644 --- a/nac3core/src/typecheck/typedef/mod.rs +++ b/nac3core/src/typecheck/typedef/mod.rs @@ -30,7 +30,13 @@ pub type IndexMapping = IndexMap; /// ID of a Python type variable. Specific to `nac3core`. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct TypeVarId(pub u32); +pub struct TypeVarId(u32); + +impl From for u32 { + fn from(value: TypeVarId) -> Self { + value.0 + } +} impl fmt::Display for TypeVarId { // NOTE: Must output the string of the ID value. Certain unit tests rely on string comparisons.