Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
refactor: remove old code, streamline errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PThorpe92 committed Apr 17, 2024
1 parent 524398c commit cf8670e
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 270 deletions.
8 changes: 4 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ impl<'a> App<'a> {
self.selected = None;
return;
}
Screen::SavedCommands(col_name) => {
Screen::SavedCommands { id, .. } => {
self.items = self
.db
.as_ref()
.get_commands(*col_name)
.get_commands(*id)
.unwrap_or_default()
.iter()
.map(|cmd| {
Expand Down Expand Up @@ -285,10 +285,10 @@ impl<'a> App<'a> {
.map(|x| x.to_string())
.collect::<Vec<String>>(),
),
Screen::SavedCommands(coll_id) => Some(
Screen::SavedCommands { id, .. } => Some(
self.db
.as_ref()
.get_commands(coll_id)
.get_commands(id)
.unwrap_or_default()
.into_iter()
.map(|x| format!("{:?}", x))
Expand Down
9 changes: 4 additions & 5 deletions src/display/inputopt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::request::curl::Method;
use crate::screens::auth::AuthType;
use crate::request::curl::{AuthKind, Method};
use std::fmt::Display;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -10,7 +9,7 @@ pub enum InputOpt {
Output,
Verbose,
RequestBody,
Auth(AuthType),
Auth(AuthKind),
VerifyPeer,
Referrer,
Execute,
Expand All @@ -30,8 +29,8 @@ pub enum InputOpt {
ImportCollection,
RenameCollection(i32),
RequestError(String),
AlertMessage(String),
Method(Method),
NewProtoFile,
}

impl InputOpt {
Expand Down Expand Up @@ -70,7 +69,7 @@ impl Display for InputOpt {
InputOpt::RequestError(ref err) => write!(f, "| Error: {}", err),
InputOpt::Method(method) => write!(f, "| Method: {}", method),
InputOpt::CookieJar => write!(f, "| Cookie Jar"),
InputOpt::NewProtoFile => write!(f, "| New Proto File"),
InputOpt::AlertMessage(msg) => write!(f, "| Alert: {}", msg),
}
}
}
Loading

0 comments on commit cf8670e

Please sign in to comment.