mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
Remove take_while from internal iterator (#3301)
This commit is contained in:
parent
2e439ca77f
commit
734877338d
@ -33,15 +33,12 @@ pub(crate) fn run_internal_command(
|
|||||||
)?
|
)?
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(InputStream::from_stream(
|
Ok(InputStream::from_stream(InternalIterator {
|
||||||
InternalIterator {
|
command,
|
||||||
command,
|
context: context.clone(),
|
||||||
context: context.clone(),
|
leftovers: vec![],
|
||||||
leftovers: vec![],
|
input: result,
|
||||||
input: result,
|
}))
|
||||||
}
|
|
||||||
.take_while(|x| !x.is_error()),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InternalIterator {
|
struct InternalIterator {
|
||||||
@ -73,6 +70,7 @@ impl Iterator for InternalIterator {
|
|||||||
CommandAction::Exit(code) => std::process::exit(code), // TODO: save history.txt
|
CommandAction::Exit(code) => std::process::exit(code), // TODO: save history.txt
|
||||||
CommandAction::Error(err) => {
|
CommandAction::Error(err) => {
|
||||||
self.context.error(err);
|
self.context.error(err);
|
||||||
|
return None;
|
||||||
}
|
}
|
||||||
CommandAction::AutoConvert(tagged_contents, extension) => {
|
CommandAction::AutoConvert(tagged_contents, extension) => {
|
||||||
let contents_tag = tagged_contents.tag.clone();
|
let contents_tag = tagged_contents.tag.clone();
|
||||||
@ -205,6 +203,7 @@ impl Iterator for InternalIterator {
|
|||||||
..
|
..
|
||||||
})) => {
|
})) => {
|
||||||
self.context.error(err);
|
self.context.error(err);
|
||||||
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(ReturnSuccess::Value(v)) => return Some(v),
|
Ok(ReturnSuccess::Value(v)) => return Some(v),
|
||||||
|
Loading…
Reference in New Issue
Block a user