From 5b4a9b48aeabded174cc161bfdafb6529cffbca1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 24 Apr 2023 21:07:48 -0400 Subject: refactor(ext/node): enforce interior mutable for `NodePermissions` to remove clones (#18831) We can make `NodePermissions` rely on interior mutability (which the `PermissionsContainer` is already doing) in order to not have to clone everything all the time. This also reduces the chance of an accidental `borrow` while `borrrow_mut`. --- cli/lsp/documents.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/lsp') diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 31aa3ae8e..3f77eaaa2 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -1074,7 +1074,7 @@ impl Documents { &specifier, referrer, NodeResolutionMode::Types, - &mut PermissionsContainer::allow_all(), + &PermissionsContainer::allow_all(), ) .ok() .flatten(), @@ -1461,7 +1461,7 @@ fn node_resolve_npm_req_ref( .resolve_npm_req_reference( &npm_req_ref, NodeResolutionMode::Types, - &mut PermissionsContainer::allow_all(), + &PermissionsContainer::allow_all(), ) .ok() .flatten(), -- cgit v1.2.3