mirror of
https://github.com/nushell/nushell
synced 2025-01-13 05:38:57 +00:00
Remove 🆖 comments (#7877)
Noticed several instances of commented out code that should just be deleted. Also a comment on `eval_external` that was incorrect. All gone now.
This commit is contained in:
parent
2849e28c2b
commit
9ae2e528c5
6 changed files with 1 additions and 95 deletions
|
@ -182,9 +182,6 @@ pub fn redirect_env(engine_state: &EngineState, caller_stack: &mut Stack, callee
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Eval external expression
|
|
||||||
///
|
|
||||||
/// It returns PipelineData with a boolean flag, indicate that if the external runs to failed.
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn eval_external(
|
fn eval_external(
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
|
|
|
@ -59,10 +59,6 @@ where
|
||||||
Ok(Some(self.ch[idx]))
|
Ok(Some(self.ch[idx]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn peek_next_or_null(&mut self, idx: usize) -> Result<u8> {
|
|
||||||
// Ok(try!(self.peek_next(idx)).unwrap_or(b'\x00'))
|
|
||||||
// }
|
|
||||||
|
|
||||||
pub fn peek(&mut self) -> Result<Option<u8>> {
|
pub fn peek(&mut self) -> Result<Option<u8>> {
|
||||||
self.peek_next(0)
|
self.peek_next(0)
|
||||||
}
|
}
|
||||||
|
@ -157,15 +153,6 @@ pub struct ParseNumber<Iter: Iterator<Item = u8>> {
|
||||||
result: Vec<u8>,
|
result: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// macro_rules! try_or_invalid {
|
|
||||||
// ($e:expr) => {
|
|
||||||
// match $e {
|
|
||||||
// Some(v) => v,
|
|
||||||
// None => { return Err(Error::Syntax(ErrorCode::InvalidNumber, 0, 0)); }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
impl<Iter: Iterator<Item = u8>> ParseNumber<Iter> {
|
impl<Iter: Iterator<Item = u8>> ParseNumber<Iter> {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(iter: Iter) -> Self {
|
pub fn new(iter: Iter) -> Self {
|
||||||
|
|
|
@ -616,7 +616,6 @@ impl PipelineData {
|
||||||
// to create the table value that will be printed in the terminal
|
// to create the table value that will be printed in the terminal
|
||||||
|
|
||||||
let config = engine_state.get_config();
|
let config = engine_state.get_config();
|
||||||
// let stdout = std::io::stdout();
|
|
||||||
|
|
||||||
if let PipelineData::ExternalStream {
|
if let PipelineData::ExternalStream {
|
||||||
stdout: stream,
|
stdout: stream,
|
||||||
|
@ -626,12 +625,6 @@ impl PipelineData {
|
||||||
} = self
|
} = self
|
||||||
{
|
{
|
||||||
return print_if_stream(stream, stderr_stream, to_stderr, exit_code);
|
return print_if_stream(stream, stderr_stream, to_stderr, exit_code);
|
||||||
/*
|
|
||||||
if let Ok(exit_code) = print_if_stream(stream, stderr_stream, to_stderr, exit_code) {
|
|
||||||
return Ok(exit_code);
|
|
||||||
}
|
|
||||||
return Ok(0);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(decl_id) = engine_state.find_decl("table".as_bytes(), &[]) {
|
if let Some(decl_id) = engine_state.find_decl("table".as_bytes(), &[]) {
|
||||||
|
|
|
@ -757,10 +757,7 @@ fn get_proc_env<T: RtlUserProcessParameters>(params: &T, handle: HANDLE) -> Vec<
|
||||||
fn get_cwd<T: RtlUserProcessParameters>(params: &T, handle: HANDLE) -> PathBuf {
|
fn get_cwd<T: RtlUserProcessParameters>(params: &T, handle: HANDLE) -> PathBuf {
|
||||||
match params.get_cwd(handle) {
|
match params.get_cwd(handle) {
|
||||||
Ok(buffer) => unsafe { PathBuf::from(null_terminated_wchar_to_string(buffer.as_slice())) },
|
Ok(buffer) => unsafe { PathBuf::from(null_terminated_wchar_to_string(buffer.as_slice())) },
|
||||||
Err(_e) => {
|
Err(_e) => PathBuf::new(),
|
||||||
// sysinfo_debug!("get_cwd failed to get data: {}", _e);
|
|
||||||
PathBuf::new()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -988,8 +985,6 @@ fn get_name(psid: PSID) -> Option<(String, String)> {
|
||||||
|
|
||||||
#[cfg_attr(tarpaulin, skip)]
|
#[cfg_attr(tarpaulin, skip)]
|
||||||
fn from_wide_ptr(ptr: *const u16) -> String {
|
fn from_wide_ptr(ptr: *const u16) -> String {
|
||||||
// use std::ffi::OsString;
|
|
||||||
// use std::os::windows::ffi::OsStringExt;
|
|
||||||
unsafe {
|
unsafe {
|
||||||
assert!(!ptr.is_null());
|
assert!(!ptr.is_null());
|
||||||
let len = (0..std::isize::MAX)
|
let len = (0..std::isize::MAX)
|
||||||
|
@ -1013,18 +1008,11 @@ impl ProcessInfo {
|
||||||
|
|
||||||
/// Name of command
|
/// Name of command
|
||||||
pub fn name(&self) -> String {
|
pub fn name(&self) -> String {
|
||||||
// self.command()
|
|
||||||
// .split(' ')
|
|
||||||
// .collect::<Vec<_>>()
|
|
||||||
// .first()
|
|
||||||
// .map(|x| x.to_string())
|
|
||||||
// .unwrap_or_default()
|
|
||||||
self.command.clone()
|
self.command.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Full name of command, with arguments
|
/// Full name of command, with arguments
|
||||||
pub fn command(&self) -> String {
|
pub fn command(&self) -> String {
|
||||||
// self.command.clone()
|
|
||||||
self.cmd.join(" ")
|
self.cmd.join(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,11 +179,6 @@ fn build_map(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if last_val.is_some() && map.is_empty() {
|
|
||||||
// let val = nu_protocol_value_to_json(last_val.unwrap());
|
|
||||||
// return serde_json::Value::Array(vec![val]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
map
|
map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,57 +1,3 @@
|
||||||
// use nu_protocol::{
|
|
||||||
// ast::{Expr, Expression},
|
|
||||||
// Span, Spanned, Type,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// pub struct ExternalBuilder {
|
|
||||||
// name: String,
|
|
||||||
// args: Vec<String>,
|
|
||||||
// }
|
|
||||||
|
|
||||||
// impl ExternalBuilder {
|
|
||||||
// pub fn for_name(name: &str) -> ExternalBuilder {
|
|
||||||
// ExternalBuilder {
|
|
||||||
// name: name.to_string(),
|
|
||||||
// args: vec![],
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// pub fn arg(&mut self, value: &str) -> &mut Self {
|
|
||||||
// self.args.push(value.to_string());
|
|
||||||
// self
|
|
||||||
// }
|
|
||||||
|
|
||||||
// pub fn build(&mut self) -> ExternalCommand {
|
|
||||||
// let mut path = crate::fs::binaries();
|
|
||||||
// path.push(&self.name);
|
|
||||||
|
|
||||||
// let name = Spanned {
|
|
||||||
// item: path.to_string_lossy().to_string(),
|
|
||||||
// span: Span::new(0, 0),
|
|
||||||
// };
|
|
||||||
|
|
||||||
// let args = self
|
|
||||||
// .args
|
|
||||||
// .iter()
|
|
||||||
// .map(|arg| Expression {
|
|
||||||
// expr: Expr::String(arg.to_string()),
|
|
||||||
// span: Span::new(0, 0),
|
|
||||||
// ty: Type::Unknown,
|
|
||||||
// custom_completion: None,
|
|
||||||
// })
|
|
||||||
// .collect::<Vec<_>>();
|
|
||||||
|
|
||||||
// ExternalCommand {
|
|
||||||
// name: name.to_string(),
|
|
||||||
// name_tag: Tag::unknown(),
|
|
||||||
// args: ExternalArgs {
|
|
||||||
// list: args,
|
|
||||||
// span: name.span,
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io::Read,
|
io::Read,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
|
|
Loading…
Reference in a new issue