mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 09:30:35 +00:00
Move binding accesses into SemanticModel
method (#5084)
This commit is contained in:
parent
1e497162d1
commit
c74ef77e85
13 changed files with 53 additions and 54 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue