diff options
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 { |