mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
better debug impls
This commit is contained in:
parent
aa628f4749
commit
164d53b22f
2 changed files with 17 additions and 2 deletions
|
@ -42,6 +42,10 @@ where
|
|||
ID: NumericId,
|
||||
LOC: Clone + Eq + Hash,
|
||||
{
|
||||
pub fn len(&self) -> usize {
|
||||
self.loc2id.len()
|
||||
}
|
||||
|
||||
pub fn loc2id(&mut self, loc: &LOC) -> ID {
|
||||
match self.loc2id.get(loc) {
|
||||
Some(id) => return id.clone(),
|
||||
|
@ -91,6 +95,9 @@ where
|
|||
ID: NumericId,
|
||||
LOC: Clone + Eq + Hash,
|
||||
{
|
||||
pub fn len(&self) -> usize {
|
||||
self.map.lock().len()
|
||||
}
|
||||
pub fn loc2id(&self, loc: &LOC) -> ID {
|
||||
self.map.lock().loc2id(loc)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue