Assert end of vararg is still EOL

This commit is contained in:
Aram 🍐 2021-08-04 02:08:42 -04:00
parent a7f730c04a
commit 1b5be8b872

View file

@ -86,6 +86,9 @@ macro_rules! impl_words {
/// Whether the `Word` matches all words in the vec, starting at the given index. /// 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<Self>]) -> bool { pub(crate) fn matches_until_end(&self, start: usize, others: &[Option<Self>]) -> bool {
for i in start..others.len() { for i in start..others.len() {
if i == others.len() {
return others[i] == Some(Self::EOL);
}
if !self.matches(others.get(i)) { if !self.matches(others.get(i)) {
return false; return false;
} }