Move binding accesses into SemanticModel method (#5084)

This commit is contained in:
Charlie Marsh 2023-06-14 10:07:46 -04:00 committed by GitHub
parent 1e497162d1
commit c74ef77e85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 53 additions and 54 deletions

View file

@ -198,15 +198,10 @@ impl nohash_hasher::IsEnabled for BindingId {}
pub struct Bindings<'a>(IndexVec<BindingId, Binding<'a>>);
impl<'a> Bindings<'a> {
/// Pushes a new binding and returns its id
/// Pushes a new [`Binding`] and returns its [`BindingId`].
pub fn push(&mut self, binding: Binding<'a>) -> BindingId {
self.0.push(binding)
}
/// Returns the id that will be assigned when pushing the next binding
pub fn next_id(&self) -> BindingId {
self.0.next_index()
}
}
impl<'a> Deref for Bindings<'a> {