diff --git a/src/cli.rs b/src/cli.rs index 34a208e08c..a5a2aebdf7 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -323,12 +323,6 @@ pub async fn cli() -> Result<(), Box> { LineResult::Break => { break; } - - LineResult::FatalError(_, err) => { - context.with_host(|host| { - host.stdout(&format!("A surprising fatal error occurred.\n{:?}", err)) - }); - } } ctrlcbreak = false; } @@ -344,9 +338,6 @@ enum LineResult { Error(String, ShellError), CtrlC, Break, - - #[allow(unused)] - FatalError(String, ShellError), } async fn process_line(readline: Result, ctx: &mut Context) -> LineResult { diff --git a/src/commands/args.rs b/src/commands/args.rs index 9c2d1f6959..c08a075dd2 100644 --- a/src/commands/args.rs +++ b/src/commands/args.rs @@ -1,17 +1,8 @@ use crate::object::Value; -#[allow(unused)] #[derive(Debug)] -pub enum LogLevel { - Trace, - Debug, - Info, - Warn, - Error, - Fatal, -} +pub enum LogLevel {} -#[allow(unused)] #[derive(Debug)] pub struct LogItem { level: LogLevel, diff --git a/src/commands/classified.rs b/src/commands/classified.rs index 6babb6c9ce..622d92e77f 100644 --- a/src/commands/classified.rs +++ b/src/commands/classified.rs @@ -84,17 +84,6 @@ pub(crate) enum ClassifiedCommand { External(ExternalCommand), } -impl ClassifiedCommand { - #[allow(unused)] - pub fn span(&self) -> Span { - match self { - ClassifiedCommand::Expr(token) => token.span(), - ClassifiedCommand::Internal(internal) => internal.name_span.into(), - ClassifiedCommand::External(external) => external.name_span.into(), - } - } -} - pub(crate) struct InternalCommand { pub(crate) command: Arc, pub(crate) name_span: Span, @@ -199,7 +188,7 @@ impl InternalCommand { pub(crate) struct ExternalCommand { pub(crate) name: String, - #[allow(unused)] + pub(crate) name_span: Span, pub(crate) args: Vec>, } diff --git a/src/commands/command.rs b/src/commands/command.rs index 9e9c823c26..67286e98a1 100644 --- a/src/commands/command.rs +++ b/src/commands/command.rs @@ -148,10 +148,6 @@ impl CommandArgs { )) } - // pub fn name_span(&self) -> Span { - // self.call_info.name_span - // } - pub fn process<'de, T: Deserialize<'de>>( self, registry: &CommandRegistry, @@ -235,11 +231,6 @@ pub struct RunnableContext { } impl RunnableContext { - #[allow(unused)] - pub fn cwd(&self) -> PathBuf { - PathBuf::from(self.shell_manager.path()) - } - pub fn expect_command(&self, name: &str) -> Arc { self.commands .get_command(name) @@ -337,8 +328,6 @@ impl EvaluatedWholeStreamCommandArgs { #[get = "pub"] pub struct EvaluatedFilterCommandArgs { args: EvaluatedCommandArgs, - #[allow(unused)] - input: Tagged, } impl Deref for EvaluatedFilterCommandArgs { @@ -353,7 +342,6 @@ impl EvaluatedFilterCommandArgs { host: Arc>, shell_manager: ShellManager, call_info: CallInfo, - input: Tagged, ) -> EvaluatedFilterCommandArgs { EvaluatedFilterCommandArgs { args: EvaluatedCommandArgs { @@ -361,7 +349,6 @@ impl EvaluatedFilterCommandArgs { shell_manager, call_info, }, - input, } } } @@ -404,7 +391,6 @@ impl EvaluatedCommandArgs { } } - #[allow(unused)] pub fn has(&self, name: &str) -> bool { self.call_info.args.has(name) } @@ -624,7 +610,6 @@ impl Command { } } -#[allow(unused)] pub struct FnFilterCommand { name: String, func: fn(EvaluatedFilterCommandArgs) -> Result, @@ -658,16 +643,13 @@ impl WholeStreamCommand for FnFilterCommand { let result = input.values.map(move |it| { let registry = registry.clone(); - let call_info = match call_info - .clone() - .evaluate(®istry, &Scope::it_value(it.clone())) - { + let call_info = match call_info.clone().evaluate(®istry, &Scope::it_value(it)) { Err(err) => return OutputStream::from(vec![Err(err)]).values, Ok(args) => args, }; let args = - EvaluatedFilterCommandArgs::new(host.clone(), shell_manager.clone(), call_info, it); + EvaluatedFilterCommandArgs::new(host.clone(), shell_manager.clone(), call_info); match func(args) { Err(err) => return OutputStream::from(vec![Err(err)]).values, @@ -689,14 +671,3 @@ pub fn whole_stream_command(command: impl WholeStreamCommand + 'static) -> Arc Arc { Arc::new(Command::PerItem(Arc::new(command))) } - -#[allow(unused)] -pub fn filter( - name: &str, - func: fn(EvaluatedFilterCommandArgs) -> Result, -) -> Arc { - Arc::new(Command::WholeStream(Arc::new(FnFilterCommand { - name: name.to_string(), - func, - }))) -} diff --git a/src/commands/get.rs b/src/commands/get.rs index 7f0512a7bc..44e3259fd8 100644 --- a/src/commands/get.rs +++ b/src/commands/get.rs @@ -60,7 +60,6 @@ fn get_member(path: &Tagged, obj: &Tagged) -> Result Ok(v.clone()), None => Ok(Value::nothing().tagged(obj.tag)), } - // Ok(current.clone()) } pub fn get( diff --git a/src/commands/last.rs b/src/commands/last.rs index 2471eec968..1f9cc62a7f 100644 --- a/src/commands/last.rs +++ b/src/commands/last.rs @@ -16,8 +16,7 @@ impl WholeStreamCommand for Last { } fn signature(&self) -> Signature { - Signature::build("last") - .required("amount", SyntaxType::Number) + Signature::build("last").required("amount", SyntaxType::Number) } fn usage(&self) -> &str { @@ -30,7 +29,6 @@ impl WholeStreamCommand for Last { registry: &CommandRegistry, ) -> Result { args.process(registry, last)?.run() - // last(args, registry) } } diff --git a/src/commands/macros.rs b/src/commands/macros.rs index 8e148de5ff..adac8d9c89 100644 --- a/src/commands/macros.rs +++ b/src/commands/macros.rs @@ -1,11 +1,4 @@ #[doc(hidden)] -#[allow(unused)] -macro_rules! named_type { - ($name:ident) => { - $crate::parser::registry::NamedType::$($name)* - } -} - #[macro_export] macro_rules! command { ( @@ -356,39 +349,4 @@ macro_rules! command { } ); }; - - // ($export:ident as $name:tt ( $args:ident, -- $param:ident : $kind:ident ) $body:block) => { - // #[allow(non_camel_case_types)] - // pub struct $export; - - // impl Command for $export { - // fn run(&self, $args: CommandArgs) -> Result { - // fn command($args: CommandArgs, $param: $kind) -> Result { - // $body - // } - - // use std::convert::TryInto; - - // let param = $args.get(stringify!($param)).try_into()?; - // command($args, param) - // } - - // fn name(&self) -> &str { - // stringify!($name) - // } - - // fn config(&self) -> Signature { - // let mut named: IndexMap = IndexMap::new(); - // named.insert(stringify!($param).to_string(), NamedType::$kind); - - // Signature { - // name: self.name().to_string(), - // mandatory_positional: vec![], - // optional_positional: vec![], - // rest_positional: false, - // named, - // } - // } - // } - // }; } diff --git a/src/commands/plugin.rs b/src/commands/plugin.rs index 2cd63c0c98..ae9b2ec64a 100644 --- a/src/commands/plugin.rs +++ b/src/commands/plugin.rs @@ -294,7 +294,6 @@ pub fn sink_plugin( args: CommandArgs, registry: &CommandRegistry, ) -> Result { - //use subprocess::Exec; let args = args.evaluate_once(registry)?; let call_info = args.call_info.clone(); diff --git a/src/commands/post.rs b/src/commands/post.rs index 551e33dd70..c1fc5d42fe 100644 --- a/src/commands/post.rs +++ b/src/commands/post.rs @@ -63,7 +63,6 @@ fn run( file => file.clone(), }; let path_str = path.as_string()?; - //let body_str = body.as_string()?; let path_span = path.span(); let has_raw = call_info.args.has("raw"); let user = call_info.args.get("user").map(|x| x.as_string().unwrap()); diff --git a/src/errors.rs b/src/errors.rs index 435f491682..3eb8e33e9c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,4 +1,3 @@ -#[allow(unused)] use crate::prelude::*; use ansi_term::Color; @@ -436,24 +435,6 @@ pub struct ShellDiagnostic { pub(crate) diagnostic: Diagnostic, } -impl ShellDiagnostic { - #[allow(unused)] - pub(crate) fn simple_diagnostic( - span: impl Into, - source: impl Into, - ) -> ShellDiagnostic { - use language_reporting::*; - - let span = span.into(); - let source = source.into(); - - let diagnostic = - Diagnostic::new(Severity::Error, "Parse error").with_label(Label::new_primary(span)); - - ShellDiagnostic { diagnostic } - } -} - impl PartialEq for ShellDiagnostic { fn eq(&self, _other: &ShellDiagnostic) -> bool { false diff --git a/src/format.rs b/src/format.rs index 7f65472855..10b92000b9 100644 --- a/src/format.rs +++ b/src/format.rs @@ -7,8 +7,7 @@ pub(crate) mod vtable; use crate::prelude::*; pub(crate) use entries::EntriesView; -#[allow(unused)] -pub(crate) use generic::GenericView; + pub(crate) use table::TableView; pub(crate) use vtable::VTableView; diff --git a/src/format/list.rs b/src/format/list.rs index a33f2078e7..6b945e1fd9 100644 --- a/src/format/list.rs +++ b/src/format/list.rs @@ -3,7 +3,7 @@ use crate::prelude::*; use derive_new::new; // A list is printed one line at a time with an optional separator between groups -#[allow(unused)] + #[derive(new)] pub struct ListView { list: Vec>, diff --git a/src/lib.rs b/src/lib.rs index 74a5cee4df..7a82741199 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ pub use crate::commands::command::{CallInfo, ReturnSuccess, ReturnValue}; pub use crate::context::{SourceMap, SpanSource}; pub use crate::env::host::BasicHost; pub use crate::parser::hir::SyntaxType; +pub use crate::parser::parse::token_tree_builder::TokenTreeBuilder; pub use crate::plugin::{serve_plugin, Plugin}; pub use crate::utils::{AbsoluteFile, AbsolutePath, RelativePath}; pub use cli::cli; diff --git a/src/object.rs b/src/object.rs index e2a8df1020..3b4dcfeb44 100644 --- a/src/object.rs +++ b/src/object.rs @@ -7,8 +7,7 @@ pub(crate) mod into; pub(crate) mod meta; pub(crate) mod types; -#[allow(unused)] -pub(crate) use base::{Block, Primitive, Switch, Value}; -pub(crate) use dict::{Dictionary, TaggedListBuilder, TaggedDictBuilder}; -pub(crate) use files::dir_entry_dict; +pub(crate) use base::{Primitive, Value}; pub(crate) use command::command_dict; +pub(crate) use dict::{Dictionary, TaggedDictBuilder, TaggedListBuilder}; +pub(crate) use files::dir_entry_dict; diff --git a/src/object/base.rs b/src/object/base.rs index 0d4709f1f1..552d2c86de 100644 --- a/src/object/base.rs +++ b/src/object/base.rs @@ -174,7 +174,7 @@ pub enum Value { #[serde(with = "serde_bytes")] Binary(Vec), List(Vec>), - #[allow(unused)] + Block(Block), } @@ -313,16 +313,6 @@ pub enum Switch { Absent, } -impl Switch { - #[allow(unused)] - pub fn is_present(&self) -> bool { - match self { - Switch::Present => true, - Switch::Absent => false, - } - } -} - impl std::convert::TryFrom>> for Switch { type Error = ShellError; @@ -395,14 +385,6 @@ impl Value { } } - #[allow(unused)] - pub(crate) fn get_data_by_index(&self, idx: usize) -> Option<&Tagged> { - match self { - Value::List(l) => l.iter().nth(idx), - _ => None, - } - } - pub fn get_data_by_path(&self, tag: Tag, path: &str) -> Option> { let mut current = self; for p in path.split(".") { @@ -539,7 +521,6 @@ impl Value { } } - #[allow(unused)] pub(crate) fn compare( &self, operator: &Operator, @@ -570,24 +551,6 @@ impl Value { } } - #[allow(unused)] - pub(crate) fn is_string(&self, expected: &str) -> bool { - match self { - Value::Primitive(Primitive::String(s)) if s == expected => true, - other => false, - } - } - - // pub(crate) fn as_pair(&self) -> Result<(Tagged, Tagged), ShellError> { - // match self { - // Value::List(list) if list.len() == 2 => Ok((list[0].clone(), list[1].clone())), - // other => Err(ShellError::string(format!( - // "Expected pair, got {:?}", - // other - // ))), - // } - // } - pub(crate) fn as_string(&self) -> Result { match self { Value::Primitive(Primitive::String(s)) => Ok(s.clone()), @@ -647,7 +610,6 @@ impl Value { Value::Primitive(Primitive::Date(s.into())) } - #[allow(unused)] pub fn date_from_str(s: &str) -> Result { let date = DateTime::parse_from_rfc3339(s) .map_err(|err| ShellError::string(&format!("Date parse error: {}", err)))?; @@ -705,95 +667,6 @@ pub(crate) fn reject_fields(obj: &Value, fields: &[String], tag: impl Into) out.into_tagged_value() } -#[allow(unused)] -pub(crate) fn find(obj: &Value, field: &str, op: &Operator, rhs: &Value) -> bool { - let descs = obj.data_descriptors(); - match descs.iter().find(|d| *d == field) { - None => false, - Some(desc) => { - let v = obj.get_data(desc).borrow().clone(); - - match v { - Value::Primitive(Primitive::Boolean(b)) => match (op, rhs) { - (Operator::Equal, Value::Primitive(Primitive::Boolean(b2))) => b == *b2, - (Operator::NotEqual, Value::Primitive(Primitive::Boolean(b2))) => b != *b2, - _ => false, - }, - Value::Primitive(Primitive::Bytes(i)) => match (op, rhs) { - (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) < *i2 - } - (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) > *i2 - } - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) <= *i2 - } - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) >= *i2 - } - (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) == *i2 - } - (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => { - BigInt::from(i) != *i2 - } - _ => false, - }, - Value::Primitive(Primitive::Int(i)) => match (op, rhs) { - (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => i < *i2, - (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => i > *i2, - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i <= *i2, - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { - i >= *i2 - } - (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => i == *i2, - (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => i != *i2, - _ => false, - }, - Value::Primitive(Primitive::Decimal(i)) => match (op, rhs) { - (Operator::LessThan, Value::Primitive(Primitive::Decimal(i2))) => i < *i2, - (Operator::GreaterThan, Value::Primitive(Primitive::Decimal(i2))) => i > *i2, - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Decimal(i2))) => { - i <= *i2 - } - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Decimal(i2))) => { - i >= *i2 - } - (Operator::Equal, Value::Primitive(Primitive::Decimal(i2))) => i == *i2, - (Operator::NotEqual, Value::Primitive(Primitive::Decimal(i2))) => i != *i2, - (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => { - i < BigDecimal::from(i2.clone()) - } - (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => { - i > BigDecimal::from(i2.clone()) - } - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { - i <= BigDecimal::from(i2.clone()) - } - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { - i >= BigDecimal::from(i2.clone()) - } - (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => { - i == BigDecimal::from(i2.clone()) - } - (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => { - i != BigDecimal::from(i2.clone()) - } - - _ => false, - }, - Value::Primitive(Primitive::String(s)) => match (op, rhs) { - (Operator::Equal, Value::Primitive(Primitive::String(s2))) => s == *s2, - (Operator::NotEqual, Value::Primitive(Primitive::String(s2))) => s != *s2, - _ => false, - }, - _ => false, - } - } - } -} - enum CompareValues { Ints(BigInt, BigInt), Decimals(BigDecimal, BigDecimal), diff --git a/src/parser/hir.rs b/src/parser/hir.rs index d46bef9247..3e155cc059 100644 --- a/src/parser/hir.rs +++ b/src/parser/hir.rs @@ -92,7 +92,6 @@ pub enum RawExpression { FilePath(PathBuf), ExternalCommand(ExternalCommand), - #[allow(unused)] Boolean(bool), } diff --git a/src/parser/hir/baseline_parse_tokens.rs b/src/parser/hir/baseline_parse_tokens.rs index 89bffc3f5f..ca9b0bb37c 100644 --- a/src/parser/hir/baseline_parse_tokens.rs +++ b/src/parser/hir/baseline_parse_tokens.rs @@ -33,7 +33,7 @@ pub fn baseline_parse_tokens( Ok(exprs) } -#[allow(unused)] + #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub enum SyntaxType { Any, diff --git a/src/parser/parse/operator.rs b/src/parser/parse/operator.rs index b7a24c79a1..1942b6012c 100644 --- a/src/parser/parse/operator.rs +++ b/src/parser/parse/operator.rs @@ -20,7 +20,7 @@ impl ToDebug for Operator { } impl Operator { - #[allow(unused)] + pub fn print(&self) -> String { self.as_str().to_string() } diff --git a/src/parser/parse/parser.rs b/src/parser/parse/parser.rs index 2f16807e37..238a144d5a 100644 --- a/src/parser/parse/parser.rs +++ b/src/parser/parse/parser.rs @@ -678,6 +678,8 @@ mod tests { use crate::parser::parse::token_tree_builder::{CurriedToken, TokenTreeBuilder}; use pretty_assertions::assert_eq; + pub type CurriedNode = Box T + 'static>; + macro_rules! assert_leaf { (parsers [ $($name:tt)* ] $input:tt -> $left:tt .. $right:tt { $kind:tt $parens:tt } ) => { $( diff --git a/src/parser/parse/token_tree.rs b/src/parser/parse/token_tree.rs index 3ecc597fdf..df189a1a0c 100644 --- a/src/parser/parse/token_tree.rs +++ b/src/parser/parse/token_tree.rs @@ -9,7 +9,7 @@ use std::fmt; #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] pub enum TokenNode { Token(Token), - #[allow(unused)] + Call(Tagged), Delimited(Tagged), Pipeline(Tagged), @@ -17,7 +17,7 @@ pub enum TokenNode { Flag(Tagged), Member(Span), Whitespace(Span), - #[allow(unused)] + Error(Tagged>), Path(Tagged), } diff --git a/src/parser/parse/token_tree_builder.rs b/src/parser/parse/token_tree_builder.rs index 38db878fea..ad4eebdc8a 100644 --- a/src/parser/parse/token_tree_builder.rs +++ b/src/parser/parse/token_tree_builder.rs @@ -1,4 +1,3 @@ -#[allow(unused)] use crate::prelude::*; use crate::parser::parse::flag::{Flag, FlagKind}; @@ -17,12 +16,9 @@ pub struct TokenTreeBuilder { pos: usize, } -#[allow(unused)] -pub type CurriedNode = Box T + 'static>; pub type CurriedToken = Box TokenNode + 'static>; pub type CurriedCall = Box Tagged + 'static>; -#[allow(unused)] impl TokenTreeBuilder { pub fn build(block: impl FnOnce(&mut Self) -> TokenNode) -> TokenNode { let mut builder = TokenTreeBuilder::new(); @@ -194,7 +190,7 @@ impl TokenTreeBuilder { Box::new(move |b| { let (start_int, end_int) = b.consume(&int.to_string()); - let (start_unit, end_unit) = b.consume(unit.as_str()); + let (_, end_unit) = b.consume(unit.as_str()); b.pos = end_unit; TokenTreeBuilder::spanned_size( diff --git a/src/parser/registry.rs b/src/parser/registry.rs index 7d22e4f85d..7112d91118 100644 --- a/src/parser/registry.rs +++ b/src/parser/registry.rs @@ -9,7 +9,6 @@ use log::trace; use serde::{Deserialize, Serialize}; use std::fmt; -#[allow(unused)] #[derive(Debug, Serialize, Deserialize, Clone)] pub enum NamedType { Switch, @@ -17,7 +16,6 @@ pub enum NamedType { Optional(SyntaxType), } -#[allow(unused)] #[derive(Debug, Clone, Serialize, Deserialize)] pub enum PositionalType { Mandatory(String, SyntaxType), @@ -45,15 +43,6 @@ impl PositionalType { PositionalType::Optional(name.to_string(), SyntaxType::Any) } - #[allow(unused)] - pub(crate) fn to_coerce_hint(&self) -> Option { - match self { - PositionalType::Mandatory(_, SyntaxType::Block) - | PositionalType::Optional(_, SyntaxType::Block) => Some(SyntaxType::Block), - _ => None, - } - } - pub(crate) fn name(&self) -> &str { match self { PositionalType::Mandatory(s, _) => s, @@ -295,11 +284,6 @@ impl Signature { Ok(args) } - - #[allow(unused)] - pub(crate) fn signature(&self) -> String { - format!("TODO") - } } pub(crate) fn evaluate_args( diff --git a/src/plugin.rs b/src/plugin.rs index a224bc6731..afd9871108 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -7,22 +7,21 @@ use std::io; pub trait Plugin { fn config(&mut self) -> Result; - #[allow(unused)] - fn begin_filter(&mut self, call_info: CallInfo) -> Result, ShellError> { + fn begin_filter(&mut self, _call_info: CallInfo) -> Result, ShellError> { Ok(vec![]) } - #[allow(unused)] - fn filter(&mut self, input: Tagged) -> Result, ShellError> { + + fn filter(&mut self, _input: Tagged) -> Result, ShellError> { Ok(vec![]) } - #[allow(unused)] + fn end_filter(&mut self) -> Result, ShellError> { Ok(vec![]) } - #[allow(unused)] - fn sink(&mut self, call_info: CallInfo, input: Vec>) {} - fn quit(&mut self){} + fn sink(&mut self, _call_info: CallInfo, _input: Vec>) {} + + fn quit(&mut self) {} } pub fn serve_plugin(plugin: &mut dyn Plugin) { diff --git a/src/plugins/binaryview.rs b/src/plugins/binaryview.rs index 7601621cd1..c321e8115c 100644 --- a/src/plugins/binaryview.rs +++ b/src/plugins/binaryview.rs @@ -331,8 +331,7 @@ pub fn view_contents( let cursor = cursor(); let _ = cursor.show(); - #[allow(unused)] - let screen = RawScreen::disable_raw_mode(); + let _ = RawScreen::disable_raw_mode(); Ok(()) } @@ -436,7 +435,6 @@ pub fn view_contents_interactive( let cursor = cursor(); let _ = cursor.show(); - #[allow(unused)] let screen = RawScreen::disable_raw_mode(); Ok(()) diff --git a/src/plugins/textview.rs b/src/plugins/textview.rs index 81db9dd194..423cae8765 100644 --- a/src/plugins/textview.rs +++ b/src/plugins/textview.rs @@ -26,8 +26,7 @@ impl TextView { impl Plugin for TextView { fn config(&mut self) -> Result { - Ok(Signature::build("textview") - .desc("Autoview of text data.")) + Ok(Signature::build("textview").desc("Autoview of text data.")) } fn sink(&mut self, call_info: CallInfo, input: Vec>) { @@ -200,8 +199,7 @@ fn scroll_view_lines_if_needed(draw_commands: Vec, use_color_buffer } let _ = cursor.show(); - #[allow(unused)] - let screen = RawScreen::disable_raw_mode(); + let _ = RawScreen::disable_raw_mode(); } } diff --git a/src/plugins/tree.rs b/src/plugins/tree.rs index f57a705eca..19e38b626c 100644 --- a/src/plugins/tree.rs +++ b/src/plugins/tree.rs @@ -64,7 +64,6 @@ impl TreeView { bold: true, ..Style::default() }; - //config.characters = UTF_CHARS_BOLD.into(); config.indent = 4; config }; @@ -80,8 +79,7 @@ struct TreeViewer; impl Plugin for TreeViewer { fn config(&mut self) -> Result { - Ok(Signature::build("tree") - .desc("View the contents of the pipeline as a tree.")) + Ok(Signature::build("tree").desc("View the contents of the pipeline as a tree.")) } fn sink(&mut self, _call_info: CallInfo, input: Vec>) { diff --git a/src/shell/completer.rs b/src/shell/completer.rs index 80ed6cfbbf..e8fdeae18e 100644 --- a/src/shell/completer.rs +++ b/src/shell/completer.rs @@ -72,9 +72,4 @@ impl NuCompleter { Ok((replace_pos, completions)) } - - // fn update(&self, line: &mut LineBuffer, start: usize, elected: &str) { - // let end = line.pos(); - // line.replace(start..end, elected) - // } } diff --git a/src/shell/filesystem_shell.rs b/src/shell/filesystem_shell.rs index 2e1623cfd8..1bb7796b5d 100644 --- a/src/shell/filesystem_shell.rs +++ b/src/shell/filesystem_shell.rs @@ -501,11 +501,6 @@ impl Shell for FilesystemShell { fn mkdir( &self, MkdirArgs { rest: directories }: MkdirArgs, - // RunnablePerItemContext { - // name, - // shell_manager, - // .. - // }: &RunnablePerItemContext, name: Span, path: &str, ) -> Result {