From 59e8dae092d976e88210ff1ed776093eceaa561f Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 29 Aug 2024 15:11:54 +0200 Subject: [PATCH] tyck: Clean up implementation of `widen` --- typecheck/src/widen.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/typecheck/src/widen.rs b/typecheck/src/widen.rs index f5199c78..6ed689a9 100644 --- a/typecheck/src/widen.rs +++ b/typecheck/src/widen.rs @@ -32,8 +32,7 @@ fn widen_inner( } } -pub fn widen(fir: &Fir>, mut type_ctx: TypeCtx) -> TypeCtx { - let primitives = core::mem::take(&mut type_ctx.primitives); +pub fn widen(fir: &Fir>, type_ctx: TypeCtx) -> TypeCtx { let types = type_ctx .types .types @@ -49,5 +48,8 @@ pub fn widen(fir: &Fir>, mut type_ctx: TypeCtx) -> Type tymap }); - TypeCtx { primitives, types } + TypeCtx { + primitives: type_ctx.primitives, + types, + } }