From 6d620c7a9ad78fb1dc6c256a6771118f67e4c77a Mon Sep 17 00:00:00 2001 From: Craig Roy Date: Mon, 4 Mar 2024 13:01:49 +0000 Subject: [PATCH] refactor: Add `From` conversion from ExtensionId to ExtensionSet --- src/extension.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/extension.rs b/src/extension.rs index 6f2859e79..6e231433d 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -502,6 +502,12 @@ impl ExtensionSet { } } +impl From for ExtensionSet { + fn from(id: ExtensionId) -> Self { + Self::singleton(&id) + } +} + fn as_typevar(e: &ExtensionId) -> Option { // Type variables are represented as radix-10 numbers, which are illegal // as standard ExtensionIds. Hence if an ExtensionId starts with a digit,