From 67c0f7009864209be0f30ef43243011a6af8d078 Mon Sep 17 00:00:00 2001 From: wiru Date: Fri, 3 May 2024 23:33:12 -0300 Subject: [PATCH] style: fixing some clippy issues --- reqtui/src/text_object/text_object.rs | 1 - .../components/api_explorer/api_explorer.rs | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/reqtui/src/text_object/text_object.rs b/reqtui/src/text_object/text_object.rs index d21d669..4668b46 100644 --- a/reqtui/src/text_object/text_object.rs +++ b/reqtui/src/text_object/text_object.rs @@ -1,7 +1,6 @@ use ratatui::{ style::Styled, text::{Line, Span}, - widgets::Paragraph, }; use ropey::Rope; diff --git a/tui/src/components/api_explorer/api_explorer.rs b/tui/src/components/api_explorer/api_explorer.rs index 111fc41..fd9f328 100644 --- a/tui/src/components/api_explorer/api_explorer.rs +++ b/tui/src/components/api_explorer/api_explorer.rs @@ -1,7 +1,6 @@ use crate::components::{ api_explorer::{ - req_uri::ReqUri, - req_uri::ReqUriState, + req_uri::{ReqUri, ReqUriState}, res_viewer::{ResViewer, ResViewerState, ResViewerTabs}, sidebar::{Sidebar, SidebarState}, }, @@ -152,12 +151,16 @@ impl<'a> ApiExplorer<'a> { Ok(None) } - fn handle_req_uri_key_event(&self, _key_event: KeyEvent) -> anyhow::Result> { - reqtui::net::handle_request( - self.selected_request.as_ref().unwrap().clone(), - self.request_tx.clone(), - self.colors.tokens.clone(), - ); + fn handle_req_uri_key_event(&mut self, key_event: KeyEvent) -> anyhow::Result> { + match key_event.code { + KeyCode::Char('i') => self.selected_pane = Some(PaneFocus::Preview), + KeyCode::Enter => reqtui::net::handle_request( + self.selected_request.as_ref().unwrap().clone(), + self.request_tx.clone(), + self.colors.tokens.clone(), + ), + _ => {} + } Ok(None) }