Handle inverted Ranges in add_span
This commit is contained in:
parent
8582173128
commit
2766961af6
1 changed files with 2 additions and 2 deletions
|
|
@ -281,8 +281,8 @@ impl AttrsList {
|
|||
|
||||
/// Add an attribute span, removes any previous matching parts of spans
|
||||
pub fn add_span(&mut self, range: Range<usize>, attrs: Attrs) {
|
||||
//do not support 1..1 even if by accident.
|
||||
if range.start == range.end {
|
||||
//do not support 1..1 or 2..1 even if by accident.
|
||||
if range.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue