summaryrefslogtreecommitdiff
path: root/src/eval/str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/str.rs')
-rw-r--r--src/eval/str.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eval/str.rs b/src/eval/str.rs
index d867e19c..22b5498b 100644
--- a/src/eval/str.rs
+++ b/src/eval/str.rs
@@ -34,6 +34,11 @@ impl Str {
Self(EcoString::new())
}
+ /// Return `true` if the length is 0.
+ pub fn is_empty(&self) -> bool {
+ self.0.len() == 0
+ }
+
/// The length of the string in bytes.
pub fn len(&self) -> i64 {
self.0.len() as i64