Upgrade to Rust 1.78 (#11260)

This commit is contained in:
Micha Reiser 2024-05-03 14:46:21 +02:00 committed by GitHub
parent 349a4cf8ce
commit 6a1e555537
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 67 additions and 549 deletions

View file

@ -189,27 +189,6 @@ impl<'a, 'print> Queue<'a> for FitsQueue<'a, 'print> {
}
}
/// Iterator that calls [`Queue::pop`] until it reaches the end of the document.
///
/// The iterator traverses into the content of any [`FormatElement::Interned`].
pub(super) struct QueueIterator<'a, 'q, Q: Queue<'a>> {
queue: &'q mut Q,
lifetime: PhantomData<&'a ()>,
}
impl<'a, Q> Iterator for QueueIterator<'a, '_, Q>
where
Q: Queue<'a>,
{
type Item = &'a FormatElement;
fn next(&mut self) -> Option<Self::Item> {
self.queue.pop()
}
}
impl<'a, Q> FusedIterator for QueueIterator<'a, '_, Q> where Q: Queue<'a> {}
pub(super) struct QueueContentIterator<'a, 'q, Q: Queue<'a>> {
queue: &'q mut Q,
kind: TagKind,

View file

@ -8,9 +8,6 @@ pub(super) trait Stack<T> {
/// Returns the last element if any
fn top(&self) -> Option<&T>;
/// Returns `true` if the stack is empty
fn is_empty(&self) -> bool;
}
impl<T> Stack<T> for Vec<T> {
@ -25,10 +22,6 @@ impl<T> Stack<T> for Vec<T> {
fn top(&self) -> Option<&T> {
self.last()
}
fn is_empty(&self) -> bool {
self.is_empty()
}
}
/// A Stack that is stacked on top of another stack. Guarantees that the underlying stack remains unchanged.
@ -80,10 +73,6 @@ where
.last()
.or_else(|| self.original.as_slice().last())
}
fn is_empty(&self) -> bool {
self.stack.is_empty() && self.original.len() == 0
}
}
#[cfg(test)]