Skip to content

Commit

Permalink
feat: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thatRichman committed Jan 12, 2025
1 parent 5398f90 commit 500b64e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wdl-lint/src/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Replacement {
/// no API for accessing the value of the final position, and the prefix sum
/// only provides the cumulative sum < index. The extra index makes it possible
/// to calculate the sum of the entire tree, which is necessary to enable
/// slices of the value up to and beyond the original end of the value.
/// slices of the new value beyond the original end position.
/// Attempting to apply a replacement at this position will panic.
#[derive(Clone, Debug)]
pub struct Fixer {
Expand Down Expand Up @@ -125,6 +125,9 @@ impl Fixer {
InsertionPoint::BeforeStart => old_start,
InsertionPoint::AfterEnd => old_end + 1,
};
// The final position in the tree is reserved
// to work around the ftree API and is not
// a valid insertion point.
assert!(
insert_at <= self.tree().len(),
"attempt to insert out-of-bounds"
Expand Down

0 comments on commit 500b64e

Please sign in to comment.