diff --git a/Cargo.lock b/Cargo.lock index deae996..3e8368a 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -587,14 +587,14 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "hac-cli" -version = "0.1.0" +version = "0.2.0" dependencies = [ "clap", ] [[package]] name = "hac-client" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "crossterm", @@ -622,7 +622,7 @@ dependencies = [ [[package]] name = "hac-colors" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "crossterm", @@ -634,7 +634,7 @@ dependencies = [ [[package]] name = "hac-config" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "dirs", @@ -645,7 +645,7 @@ dependencies = [ [[package]] name = "hac-core" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "hac-config", diff --git a/Cargo.toml b/Cargo.toml index 9a40a00..f030cc2 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ resolver = "2" name = "hac" [workspace.package] -version = "0.1.0" +version = "0.2.0" [workspace.dependencies] hac-config = { path = "hac-config" } diff --git a/hac-cli/Cargo.toml b/hac-cli/Cargo.toml index f93c340..da888d2 100755 --- a/hac-cli/Cargo.toml +++ b/hac-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-cli" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-client/Cargo.toml b/hac-client/Cargo.toml index 64c3504..5002a0f 100755 --- a/hac-client/Cargo.toml +++ b/hac-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-client" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-client/src/app.rs b/hac-client/src/app.rs index 28749e9..71bcdfc 100755 --- a/hac-client/src/app.rs +++ b/hac-client/src/app.rs @@ -23,7 +23,6 @@ impl<'app> App<'app> { config: &'app hac_config::Config, dry_run: bool, ) -> anyhow::Result { - let terminal = Terminal::new(CrosstermBackend::new(std::io::stdout()))?; Ok(Self { screen_manager: ScreenManager::new( diff --git a/hac-client/src/pages/collection_viewer/request_editor.rs b/hac-client/src/pages/collection_viewer/request_editor.rs index 078a672..87a08d5 100755 --- a/hac-client/src/pages/collection_viewer/request_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor.rs @@ -162,7 +162,7 @@ impl<'re> RequestEditor<'re> { ReqEditorTabs::Body => self.body_editor.draw(frame, size)?, ReqEditorTabs::Headers => self.headers_editor.draw(frame, size)?, ReqEditorTabs::Query => UnderConstruction::new(self.colors).draw(frame, size)?, - ReqEditorTabs::Auth => self.auth_editor.draw(frame, size)?, + ReqEditorTabs::Auth => UnderConstruction::new(self.colors).draw(frame, size)?, } Ok(()) @@ -285,13 +285,17 @@ impl Eventful for RequestEditor<'_> { }, ReqEditorTabs::Headers => match self.headers_editor.handle_key_event(key_event)? { Some(HeadersEditorEvent::Quit) => return Ok(Some(RequestEditorEvent::Quit)), + Some(HeadersEditorEvent::RemoveSelection) => { + return Ok(Some(RequestEditorEvent::RemoveSelection)) + } None => {} }, ReqEditorTabs::Query => {} - ReqEditorTabs::Auth => match self.auth_editor.handle_key_event(key_event)? { - Some(_) => todo!(), - None => {} - }, + ReqEditorTabs::Auth => { + if (self.auth_editor.handle_key_event(key_event)?).is_some() { + todo!() + } + } } Ok(None) diff --git a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs index 72fa323..297b58b 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs @@ -5,12 +5,12 @@ use crate::pages::{Eventful, Renderable}; #[derive(Debug)] pub struct AuthEditor<'ae> { - colors: &'ae hac_colors::colors::Colors, + _colors: &'ae hac_colors::colors::Colors, } impl<'ae> AuthEditor<'ae> { pub fn new(colors: &'ae hac_colors::colors::Colors) -> Self { - AuthEditor { colors } + AuthEditor { _colors: colors } } } @@ -25,7 +25,7 @@ impl Renderable for AuthEditor<'_> { impl Eventful for AuthEditor<'_> { type Result = (); - fn handle_key_event(&mut self, key_event: KeyEvent) -> anyhow::Result> { + fn handle_key_event(&mut self, _key_event: KeyEvent) -> anyhow::Result> { Ok(None) } } diff --git a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs index 641939a..9f4d301 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs @@ -43,7 +43,7 @@ pub struct BodyEditor<'be> { /// Only KeyAction::Complex are stored here as any other kind of key action can be acted upon /// instantly keymap_buffer: Option, - collection_store: Rc>, + _collection_store: Rc>, } impl<'be> BodyEditor<'be> { @@ -60,7 +60,7 @@ impl<'be> BodyEditor<'be> { Self { body, tree, - collection_store, + _collection_store: collection_store, styled_display, cursor: Cursor::default(), editor_mode: EditorMode::Normal, diff --git a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs index 9ca7b9b..199e10f 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs @@ -23,6 +23,7 @@ use super::headers_editor_edit_form::{HeadersEditorForm, HeadersEditorFormEvent} #[derive(Debug)] pub enum HeadersEditorEvent { Quit, + RemoveSelection, } #[derive(Debug)] @@ -438,6 +439,7 @@ impl Eventful for HeadersEditor<'_> { .borrow_mut() .push_overlay(CollectionViewerOverlay::HeadersForm(self.selected_row)); } + KeyCode::Esc => return Ok(Some(HeadersEditorEvent::RemoveSelection)), KeyCode::Char('n') => { let idx = headers.len(); headers.push(HeaderMap { diff --git a/hac-client/src/pages/collection_viewer/sidebar/create_request_form.rs b/hac-client/src/pages/collection_viewer/sidebar/create_request_form.rs index 87c95f4..4e0c6ca 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/create_request_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/create_request_form.rs @@ -53,7 +53,6 @@ impl<'rf> RequestForm<'rf, RequestFormCreate> { marker: std::marker::PhantomData, request: None, no_available_parent_timer: None, - previous_parent: None, } } } diff --git a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs index cc9001e..6766369 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs @@ -1,5 +1,3 @@ -use hac_core::collection::types::*; - use crate::ascii::LOGO_ASCII; use crate::pages::collection_viewer::collection_store::CollectionStore; use crate::pages::input::Input; diff --git a/hac-client/src/pages/collection_viewer/sidebar/edit_request_form.rs b/hac-client/src/pages/collection_viewer/sidebar/edit_request_form.rs index 1011e1e..c8b4f71 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/edit_request_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/edit_request_form.rs @@ -80,7 +80,6 @@ impl<'rf> RequestForm<'rf, RequestFormEdit> { marker: std::marker::PhantomData, request: Some(request), no_available_parent_timer: None, - previous_parent: None, } } } diff --git a/hac-client/src/pages/collection_viewer/sidebar/request_form.rs b/hac-client/src/pages/collection_viewer/sidebar/request_form.rs index b66193f..d3e670b 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/request_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/request_form.rs @@ -71,9 +71,6 @@ pub struct RequestForm<'rf, State = RequestFormCreate> { /// lifetimes or to Rc our way to hell, along with it we also store the name /// for displaying purposes pub parent_dir: Option<(String, String)>, - /// the previous parent of the request, used when editing to remove the request - /// from the previous directory when changing parents - pub previous_parent: Option, /// which form field is currently focused, so we can direct interactions /// accordingly pub focused_field: FormField, diff --git a/hac-colors/Cargo.toml b/hac-colors/Cargo.toml index c5dbe59..47ed969 100755 --- a/hac-colors/Cargo.toml +++ b/hac-colors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-colors" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-config/Cargo.toml b/hac-config/Cargo.toml index 951ff99..d117611 100755 --- a/hac-config/Cargo.toml +++ b/hac-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-config" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-core/Cargo.toml b/hac-core/Cargo.toml index 6b5c7c3..03a393b 100755 --- a/hac-core/Cargo.toml +++ b/hac-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-core" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-core/src/collection/errors.rs b/hac-core/src/collection/errors.rs index f953405..8cc1df0 100755 --- a/hac-core/src/collection/errors.rs +++ b/hac-core/src/collection/errors.rs @@ -20,4 +20,3 @@ where CollectionError::Unknown(msg) } } -