From 6f3ad4430c58102d1e2b820af93a835b6142968a Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Sun, 4 Aug 2024 01:30:08 -0400 Subject: [PATCH] Invert text_for_attribute assertion --- crates/runtime/src/line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/runtime/src/line.rs b/crates/runtime/src/line.rs index fe538ef1..3da9a081 100644 --- a/crates/runtime/src/line.rs +++ b/crates/runtime/src/line.rs @@ -148,7 +148,7 @@ impl Line { /// Returns the substring of [`Line::text`] covered by the passed `attribute`s [`MarkupAttribute::position`] and [`MarkupAttribute::length`] fields. pub fn text_for_attribute(&self, attribute: &MarkupAttribute) -> &str { assert!( - self.text.len() <= attribute.position + attribute.length, + self.text.len() >= attribute.position + attribute.length, "Attribute \"{attribute}\" represents a range not representable by this text: \"{}\". \ Does this MarkupAttribute belong to this MarkupParseResult?", self.text