From 5e35f191fc5e1055f8696c82c39cfa2a3ac70bff Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Tue, 15 Jan 2019 20:26:46 -0800 Subject: add has_semi to ExprStmt --- crates/ra_syntax/src/ast.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/ra_syntax') 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 { } } +impl ExprStmt { + pub fn has_semi(&self) -> bool { + match self.syntax().last_child() { + None => false, + Some(node) => node.kind() == SEMI, + } + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum PathSegmentKind<'a> { Name(&'a NameRef), -- cgit v1.2.3