mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
tighten up invariants
This commit is contained in:
parent
18d4737fb9
commit
57e6ef0bfb
3 changed files with 17 additions and 14 deletions
|
@ -51,11 +51,8 @@ impl Tokens {
|
|||
/// tokens.push(curr_joint)
|
||||
/// ```
|
||||
#[inline]
|
||||
pub fn was_joint(&mut self, yes: bool) {
|
||||
let idx = self.len();
|
||||
if yes && idx > 0 {
|
||||
self.set_joint(idx - 1);
|
||||
}
|
||||
pub fn was_joint(&mut self) {
|
||||
self.set_joint(self.len() - 1);
|
||||
}
|
||||
#[inline]
|
||||
pub fn push_ident(&mut self, contextual_kw: SyntaxKind) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue