Skip to content

Commit 03a6203

Browse files
committed
Rename Iter to NodeList
1 parent f2d7305 commit 03a6203

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ast.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ pub enum UnionElement {
6363
Index(i64),
6464
}
6565

66-
type Iter<'a> = Box<dyn Iterator<Item = &'a Value> + 'a>;
66+
// NodeList is an iterator over references to Values named after the Nodelist term in the spec.
67+
type NodeList<'a> = Box<dyn Iterator<Item = &'a Value> + 'a>;
6768

6869
impl Path {
69-
pub fn find<'a>(&'a self, input: &'a Value) -> Iter<'a> {
70+
pub fn find<'a>(&'a self, input: &'a Value) -> NodeList<'a> {
7071
match self {
7172
Path::Root => Box::new(std::iter::once(input)),
7273
Path::Sel(left, sel) => Box::new(left.find(input).flat_map(move |v| sel.find(v))),
@@ -75,7 +76,7 @@ impl Path {
7576
}
7677

7778
impl Selector {
78-
pub fn find<'a>(&'a self, input: &'a Value) -> Iter<'a> {
79+
pub fn find<'a>(&'a self, input: &'a Value) -> NodeList<'a> {
7980
match self {
8081
Selector::Union(indices) => Box::new(indices.iter().flat_map(move |i| i.find(input))),
8182
Selector::DotName(name) => Box::new(input.get(name).into_iter()),
@@ -89,7 +90,7 @@ impl Selector {
8990
}
9091

9192
impl UnionElement {
92-
pub fn find<'a>(&self, v: &'a Value) -> Iter<'a> {
93+
pub fn find<'a>(&self, v: &'a Value) -> NodeList<'a> {
9394
match self {
9495
UnionElement::Name(name) => Box::new(v.get(name).into_iter()),
9596
UnionElement::Slice(slice) => {

0 commit comments

Comments
 (0)