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:
Reilly Wood 2023-01-27 05:48:31 -08:00 committed by GitHub
parent 2849e28c2b
commit 9ae2e528c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 95 deletions

View file

@ -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)]
fn eval_external(
engine_state: &EngineState,

View file

@ -59,10 +59,6 @@ where
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>> {
self.peek_next(0)
}
@ -157,15 +153,6 @@ pub struct ParseNumber<Iter: Iterator<Item = 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> {
#[inline]
pub fn new(iter: Iter) -> Self {

View file

@ -616,7 +616,6 @@ impl PipelineData {
// to create the table value that will be printed in the terminal
let config = engine_state.get_config();
// let stdout = std::io::stdout();
if let PipelineData::ExternalStream {
stdout: stream,
@ -626,12 +625,6 @@ impl PipelineData {
} = self
{
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(), &[]) {

View file

@ -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 {
match params.get_cwd(handle) {
Ok(buffer) => unsafe { PathBuf::from(null_terminated_wchar_to_string(buffer.as_slice())) },
Err(_e) => {
// sysinfo_debug!("get_cwd failed to get data: {}", _e);
PathBuf::new()
}
Err(_e) => PathBuf::new(),
}
}
@ -988,8 +985,6 @@ fn get_name(psid: PSID) -> Option<(String, String)> {
#[cfg_attr(tarpaulin, skip)]
fn from_wide_ptr(ptr: *const u16) -> String {
// use std::ffi::OsString;
// use std::os::windows::ffi::OsStringExt;
unsafe {
assert!(!ptr.is_null());
let len = (0..std::isize::MAX)
@ -1013,18 +1008,11 @@ impl ProcessInfo {
/// Name of command
pub fn name(&self) -> String {
// self.command()
// .split(' ')
// .collect::<Vec<_>>()
// .first()
// .map(|x| x.to_string())
// .unwrap_or_default()
self.command.clone()
}
/// Full name of command, with arguments
pub fn command(&self) -> String {
// self.command.clone()
self.cmd.join(" ")
}

View file

@ -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
}

View file

@ -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::{
io::Read,
process::{Command, Stdio},