Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zslayton committed Dec 9, 2024
1 parent 48f0918 commit fcd5368
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
25 changes: 2 additions & 23 deletions src/lazy/expanded/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ fn expand_next_sequence_value<'top, D: Decoder>(
expand_next_sequence_value_from_resolved(evaluator, &mut resolving_iter)
}

pub(crate) fn expand_next_sequence_value_from_resolved<'top, D: Decoder>(
fn expand_next_sequence_value_from_resolved<'top, D: Decoder>(
evaluator: &mut MacroEvaluator<'top, D>,
iter: &mut impl Iterator<Item = IonResult<ValueExpr<'top, D>>>,
) -> Option<IonResult<LazyExpandedValue<'top, D>>> {
Expand Down Expand Up @@ -360,7 +360,7 @@ pub(crate) fn expand_next_sequence_value_from_resolved<'top, D: Decoder>(
}

/// Represents a sequence (list or sexp) whose contents are being traversed.
/// This is used in (e.g.) `make_sexp` to store an iterator for each of its
/// This is used in `flatten` to store an iterator for each of its
/// sequence arguments in turn.
#[derive(Debug)]
pub enum ExpandedSequenceIterator<'top, D: Decoder> {
Expand All @@ -379,24 +379,3 @@ impl<'top, D: Decoder> Iterator for ExpandedSequenceIterator<'top, D> {
}
}
}

/// Represents a sequence (list or sexp) whose contents are being traversed.
/// This is used in (e.g.) `make_sexp` to store an iterator for each of its
/// sequence arguments in turn.
#[derive(Debug)]
pub enum FlattenedSequence<'top, D: Decoder> {
List(&'top mut ExpandedListIterator<'top, D>),
SExp(&'top mut ExpandedSExpIterator<'top, D>),
}

impl<'top, D: Decoder> Iterator for FlattenedSequence<'top, D> {
type Item = IonResult<LazyExpandedValue<'top, D>>;

fn next(&mut self) -> Option<Self::Item> {
use FlattenedSequence::*;
match self {
List(l) => l.next(),
SExp(s) => s.next(),
}
}
}
2 changes: 1 addition & 1 deletion src/lazy/system_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ mod tests {
use crate::lazy::decoder::RawVersionMarker;
use crate::lazy::system_stream_item::SystemStreamItem;
use crate::{
v1_0, v1_1, AnyEncoding, Catalog, IonResult, SequenceWriter, SymbolRef, ValueWriter, Writer,
v1_0, AnyEncoding, Catalog, IonResult, SequenceWriter, SymbolRef, ValueWriter, Writer,
};

use super::*;
Expand Down

0 comments on commit fcd5368

Please sign in to comment.