Skip to content

Commit

Permalink
refactor: Add From conversion from ExtensionId to ExtensionSet
Browse files Browse the repository at this point in the history
  • Loading branch information
croyzor committed Mar 4, 2024
1 parent 065f675 commit 6d620c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ impl ExtensionSet {
}
}

impl From<ExtensionId> for ExtensionSet {
fn from(id: ExtensionId) -> Self {
Self::singleton(&id)
}
}

fn as_typevar(e: &ExtensionId) -> Option<usize> {
// Type variables are represented as radix-10 numbers, which are illegal
// as standard ExtensionIds. Hence if an ExtensionId starts with a digit,
Expand Down

0 comments on commit 6d620c7

Please sign in to comment.