mirror of
https://github.com/arampoire/nut-rs.git
synced 2025-11-30 16:20:25 -05:00
Assert end of vararg is still EOL
This commit is contained in:
parent
a7f730c04a
commit
1b5be8b872
1 changed files with 3 additions and 0 deletions
|
|
@ -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<Self>]) -> 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue