From 1b5be8b87219c2f2523c518db75f3ab002e686b7 Mon Sep 17 00:00:00 2001 From: Aram Peres Date: Wed, 4 Aug 2021 02:08:42 -0400 Subject: [PATCH] Assert end of vararg is still EOL --- rups/src/proto/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rups/src/proto/mod.rs b/rups/src/proto/mod.rs index 2de84a4..02f4bb3 100644 --- a/rups/src/proto/mod.rs +++ b/rups/src/proto/mod.rs @@ -86,6 +86,9 @@ macro_rules! impl_words { /// Whether the `Word` matches all words in the vec, starting at the given index. pub(crate) fn matches_until_end(&self, start: usize, others: &[Option]) -> bool { for i in start..others.len() { + if i == others.len() { + return others[i] == Some(Self::EOL); + } if !self.matches(others.get(i)) { return false; }