From 52493a0b73fc18023caa22fb0cefbdbeae5893cf Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 13 Feb 2024 10:36:43 -0500 Subject: [PATCH] Complete string to list conversion with as --- src/abstract_tree/as.rs | 10 +++++----- src/main.rs | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/abstract_tree/as.rs b/src/abstract_tree/as.rs index 41d49a2..1a3aa04 100644 --- a/src/abstract_tree/as.rs +++ b/src/abstract_tree/as.rs @@ -34,7 +34,7 @@ impl AbstractTree for As { Ok(self.r#type.clone()) } - fn validate(&self, source: &str, context: &Context) -> Result<(), ValidationError> { + fn validate(&self, _source: &str, context: &Context) -> Result<(), ValidationError> { let expected_type = self.expression.expected_type(context)?; if let Type::List(item_type) = &self.r#type { @@ -48,20 +48,20 @@ impl AbstractTree for As { }); } } + Type::String => {} Type::Any => todo!(), Type::Boolean => todo!(), Type::Collection => todo!(), Type::Custom(_) => todo!(), Type::Float => todo!(), Type::Function { - parameter_types, - return_type, + parameter_types: _, + return_type: _, } => todo!(), Type::Integer => todo!(), Type::Map(_) => todo!(), Type::None => todo!(), Type::Number => todo!(), - Type::String => todo!(), Type::Range => todo!(), Type::Option(_) => todo!(), } @@ -101,7 +101,7 @@ impl AbstractTree for As { } impl Format for As { - fn format(&self, output: &mut String, indent_level: u8) { + fn format(&self, _output: &mut String, _indent_level: u8) { todo!() } } diff --git a/src/main.rs b/src/main.rs index 112dfbd..e5c20ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,9 +4,8 @@ use clap::{Parser, Subcommand}; use crossterm::event::{KeyCode, KeyModifiers}; use nu_ansi_term::{Color, Style}; use reedline::{ - default_emacs_keybindings, ColumnarMenu, Completer, DefaultHinter, EditCommand, Emacs, - Highlighter, Prompt, Reedline, ReedlineEvent, ReedlineMenu, Signal, Span, SqliteBackedHistory, - StyledText, Suggestion, + default_emacs_keybindings, ColumnarMenu, Completer, DefaultHinter, EditCommand, Emacs, Prompt, + Reedline, ReedlineEvent, ReedlineMenu, Signal, Span, SqliteBackedHistory, Suggestion, }; use std::{borrow::Cow, fs::read_to_string, path::PathBuf, process::Command};