Improve range and internal iteration (#3300)

This commit is contained in:
Jonathan Turner
2021-04-11 13:31:08 +12:00
committed by GitHub
parent a853880e07
commit 2e439ca77f
9 changed files with 271 additions and 298 deletions

View File

@@ -27,9 +27,10 @@ impl InputStream {
}
pub fn one(item: impl Into<Value>) -> InputStream {
let mut v: VecDeque<Value> = VecDeque::new();
v.push_back(item.into());
v.into()
InputStream {
values: Box::new(std::iter::once(item.into())),
empty: false,
}
}
pub fn into_vec(self) -> Vec<Value> {