aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assists/apply_demorgan.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-06 15:58:57 +0000
committerAleksey Kladov <[email protected]>2020-02-06 16:12:02 +0000
commitcf812c12d1ac7944d1c18877ee93bea02d91e99f (patch)
tree71e13733941e2c0520cfe5d16fb00f428f3233da /crates/ra_assists/src/assists/apply_demorgan.rs
parentf8965ffafd5cf467b3f0482ca962ba2bfd090161 (diff)
Assists are not generic
Diffstat (limited to 'crates/ra_assists/src/assists/apply_demorgan.rs')
-rw-r--r--crates/ra_assists/src/assists/apply_demorgan.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/apply_demorgan.rs b/crates/ra_assists/src/assists/apply_demorgan.rs
index 666dce4e6..dac6280ad 100644
--- a/crates/ra_assists/src/assists/apply_demorgan.rs
+++ b/crates/ra_assists/src/assists/apply_demorgan.rs
@@ -1,5 +1,4 @@
1use super::invert_if::invert_boolean_expression; 1use super::invert_if::invert_boolean_expression;
2use hir::db::HirDatabase;
3use ra_syntax::ast::{self, AstNode}; 2use ra_syntax::ast::{self, AstNode};
4 3
5use crate::{Assist, AssistCtx, AssistId}; 4use crate::{Assist, AssistCtx, AssistId};
@@ -23,7 +22,7 @@ use crate::{Assist, AssistCtx, AssistId};
23// if !(x == 4 && y) {} 22// if !(x == 4 && y) {}
24// } 23// }
25// ``` 24// ```
26pub(crate) fn apply_demorgan(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 25pub(crate) fn apply_demorgan(ctx: AssistCtx) -> Option<Assist> {
27 let expr = ctx.find_node_at_offset::<ast::BinExpr>()?; 26 let expr = ctx.find_node_at_offset::<ast::BinExpr>()?;
28 let op = expr.op_kind()?; 27 let op = expr.op_kind()?;
29 let op_range = expr.op_token()?.text_range(); 28 let op_range = expr.op_token()?.text_range();