From 500b64e382c767aeae6f3be96cc3f84cd31294fb Mon Sep 17 00:00:00 2001 From: thatrichman Date: Sun, 12 Jan 2025 12:33:04 -0500 Subject: [PATCH] feat: add comments --- wdl-lint/src/fix.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wdl-lint/src/fix.rs b/wdl-lint/src/fix.rs index 3fea44a4..982a888a 100644 --- a/wdl-lint/src/fix.rs +++ b/wdl-lint/src/fix.rs @@ -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 { @@ -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"