mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 03:27:50 +02:00
Improve range and internal iteration (#3300)
This commit is contained in:
@ -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> {
|
||||
|
@ -8,19 +8,6 @@ macro_rules! return_err {
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! stream {
|
||||
($($expr:expr),*) => {{
|
||||
let mut v = VecDeque::new();
|
||||
|
||||
$(
|
||||
v.push_back($expr);
|
||||
)*
|
||||
|
||||
v
|
||||
}}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! trace_out_stream {
|
||||
(target: $target:tt, $desc:tt = $expr:expr) => {{
|
||||
|
Reference in New Issue
Block a user