From 4161bad54f690e77f53ca1f0f4426161e60fa4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barv=C3=AD=C5=99?= Date: Fri, 31 Mar 2023 17:13:31 +0200 Subject: FIX lint clippy::len_without_is_empty (#451) --- src/syntax/node.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/syntax/node.rs') diff --git a/src/syntax/node.rs b/src/syntax/node.rs index afbebe97..3c9bc049 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -53,6 +53,11 @@ impl SyntaxNode { } } + /// Return `true` if the length is 0. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// The byte length of the node in the source text. pub fn len(&self) -> usize { match &self.0 { -- cgit v1.2.3