aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorYerkebulan Tulibergenov <[email protected]>2019-01-16 04:26:46 +0000
committerYerkebulan Tulibergenov <[email protected]>2019-01-16 04:26:46 +0000
commit5e35f191fc5e1055f8696c82c39cfa2a3ac70bff (patch)
treec8261ec2c2db4829883edb927aa2dc56f06fda12 /crates
parent4149285bf55c4a7c10b6e72c83addb675b48a687 (diff)
add has_semi to ExprStmt
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_syntax/src/ast.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 8bf439b60..e6b5e407d 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -296,6 +296,15 @@ impl IfExpr {
296 } 296 }
297} 297}
298 298
299impl ExprStmt {
300 pub fn has_semi(&self) -> bool {
301 match self.syntax().last_child() {
302 None => false,
303 Some(node) => node.kind() == SEMI,
304 }
305 }
306}
307
299#[derive(Debug, Clone, Copy, PartialEq, Eq)] 308#[derive(Debug, Clone, Copy, PartialEq, Eq)]
300pub enum PathSegmentKind<'a> { 309pub enum PathSegmentKind<'a> {
301 Name(&'a NameRef), 310 Name(&'a NameRef),