diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-26 00:28:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-26 00:28:02 +0100 |
commit | 8483fb0f269c819cf0970c25cf81660622f1d763 (patch) | |
tree | 67cf42ced1ace4919f051204f14f2f09cc2e8c4c /crates/ide/src/syntax_highlighting/tests.rs | |
parent | 5587d0a3e3599063a8993e9a44a7628abbabae8b (diff) | |
parent | 8960a0895126d1e964cb7488233b2c665a5bd0db (diff) |
Merge #8996
8996: Fix bug where library functions were not highlighted as such r=arzg a=arzg
Sorry about forgetting to test this in my last PR.
Co-authored-by: Aramis Razzaghipour <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index be4447ebb..662b53481 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -232,7 +232,7 @@ fn use_foo_items() { | |||
232 | 232 | ||
233 | let control_flow = foo::identity(foo::ControlFlow::Continue); | 233 | let control_flow = foo::identity(foo::ControlFlow::Continue); |
234 | 234 | ||
235 | if let foo::ControlFlow::Die = control_flow { | 235 | if control_flow.should_die() { |
236 | foo::die!(); | 236 | foo::die!(); |
237 | } | 237 | } |
238 | } | 238 | } |
@@ -249,6 +249,12 @@ pub enum ControlFlow { | |||
249 | Die, | 249 | Die, |
250 | } | 250 | } |
251 | 251 | ||
252 | impl ControlFlow { | ||
253 | pub fn should_die(self) -> bool { | ||
254 | matches!(self, ControlFlow::Die) | ||
255 | } | ||
256 | } | ||
257 | |||
252 | pub fn identity<T>(x: T) -> T { x } | 258 | pub fn identity<T>(x: T) -> T { x } |
253 | 259 | ||
254 | pub mod consts { | 260 | pub mod consts { |