Self { list: list.into() }
}
+ /// Create a new empty list with a specified maximum capacity.
+ pub fn with_capacity(capacity: usize) -> Self {
+ Self {
+ list: Vec::with_capacity(capacity)
+ }
+ }
+
+ /// Add another entry.
pub fn push(&mut self, entry: MatchEntry) {
self.list.push(entry)
}
+ /// Remove the list entry.
pub fn pop(&mut self) -> Option<MatchEntry> {
self.list.pop()
}
}
}
+impl Into<Vec<MatchEntry>> for MatchList {
+ fn into(self) -> Vec<MatchEntry> {
+ self.list
+ }
+}
+
impl std::ops::Deref for MatchList {
type Target = MatchListRef;