Remove old alias implementation (#8797)

This commit is contained in:
Jakub Žádník
2023-04-07 21:09:38 +03:00
committed by GitHub
parent d881481758
commit 1b677f167e
39 changed files with 387 additions and 1818 deletions

View File

@ -1,4 +1,3 @@
use itertools::Itertools;
use nu_engine::CallExt;
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack};
@ -133,15 +132,6 @@ impl Command for ViewSource {
Vec::new(),
))
}
} else if let Some(alias_id) = engine_state.find_alias(val.as_bytes(), &[]) {
let contents = &mut engine_state.get_alias(alias_id).iter().map(|span| {
String::from_utf8_lossy(engine_state.get_span_contents(span)).to_string()
});
Ok(Value::String {
val: contents.join(" "),
span: call.head,
}
.into_pipeline_data())
} else {
Err(ShellError::GenericError(
"Cannot view value".to_string(),