mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Optimize salsa some more
This commit is contained in:
parent
f89d17b426
commit
cc4d0e1bd1
13 changed files with 146 additions and 147 deletions
|
@ -42,9 +42,9 @@ impl Durability {
|
|||
pub(crate) const MAX: Durability = Self::HIGH;
|
||||
|
||||
/// Number of durability levels.
|
||||
pub(crate) const LEN: usize = 3;
|
||||
pub(crate) const LEN: usize = Self::MAX.index() + 1;
|
||||
|
||||
pub(crate) fn index(self) -> usize {
|
||||
pub(crate) const fn index(self) -> usize {
|
||||
self.0 as usize
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue