Please see https://github.com/sharkdp/bat/issues/906 as this problem was discovered by another package using your highlighter.
mod state {
pub struct State<const S: &'static str> {
total: u32,
}
impl State<"init"> {
pub fn new() -> Self {
Self { total: 0 }
}
pub fn accumulate(self) -> State<"accumulate"> {
State { total: self.total }
}
}
impl State<"accumulate"> {
pub fn add(&mut self, add: u32) {
self.total += add
}
pub fn freeze(self) -> State<"freeze"> {
State { total: self.total }
}
}
}
Observer - 2nd impl (and everything that follows it) not highlighted properly.

there is a PR open which may fix this: https://github.com/sublimehq/Packages/pull/2305
(unfortunately I'm not in a position to check atm)
unfortunately I'm not in a position to check atm
Since I'm using this package indirectly (bat uses it to highlight sources, and I install bat from its central repo), I'm not in a position to check it at all.
Hopefully, you'd be able to check it later?
bat maintainer explained how I could try this. So, I cloned this repo, applied #2305 - and it worked as expected, fixing the problems I experienced syntax-highlighting Rust source code.
This is what it looks like with the mensioned PR.

I'd say there's still an issue with the closing > in State<...> but the overall look is a bit better.
Most helpful comment
This is what it looks like with the mensioned PR.
I'd say there's still an issue with the closing
>inState<...>but the overall look is a bit better.