Skip to content

Commit

Permalink
Invert text_for_attribute assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
exvacuum committed Aug 4, 2024
1 parent bf1b533 commit 6f3ad44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/runtime/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f3ad44

Please sign in to comment.