Skip to content

Commit

Permalink
Rename config -> collection
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Nov 14, 2023
1 parent fff8c7b commit d7ffce5
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
config::{ProfileId, RequestCollection, RequestRecipeId},
collection::{ProfileId, RequestCollection, RequestRecipeId},
http::{HttpEngine, Repository, RequestBuilder},
template::{Prompt, Prompter, TemplateContext},
util::{find_by, ResultExt},
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs → src/collection.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! A request collection defines recipes, profiles, etc. that make requests
//! possible
mod insomnia;

use crate::template::TemplateString;
Expand Down
2 changes: 1 addition & 1 deletion src/config/insomnia.rs → src/collection/insomnia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! format
use crate::{
config::{Profile, RequestCollection, RequestRecipe},
collection::{Profile, RequestCollection, RequestRecipe},
template::TemplateString,
};
use anyhow::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/factory.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
config::{Chain, ChainSource, RequestRecipeId},
collection::{Chain, ChainSource, RequestRecipeId},
http::{Body, Repository, Request, RequestId, RequestRecord, Response},
template::{Prompt, Prompter, TemplateContext, TemplateString},
};
Expand Down
2 changes: 1 addition & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub use record::*;
pub use repository::*;

use crate::{
config::RequestRecipe, template::TemplateContext, util::ResultExt,
collection::RequestRecipe, template::TemplateContext, util::ResultExt,
};
use anyhow::Context;
use chrono::Utc;
Expand Down
2 changes: 1 addition & 1 deletion src/http/record.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! HTTP-related data types
use crate::{
config::RequestRecipeId,
collection::RequestRecipeId,
http::{parse, ContentType},
util::ResultExt,
};
Expand Down
2 changes: 1 addition & 1 deletion src/http/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! caching and other ephemeral data (e.g. prettified content).
use crate::{
config::{CollectionId, RequestRecipeId},
collection::{CollectionId, RequestRecipeId},
http::{Request, RequestId, RequestRecord, Response},
util::{data_directory, ResultExt},
};
Expand Down
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![feature(try_blocks)]

mod cli;
mod config;
mod collection;
#[cfg(test)]
mod factory;
mod http;
Expand All @@ -15,7 +15,8 @@ mod tui;
mod util;

use crate::{
cli::Subcommand, config::RequestCollection, tui::Tui, util::data_directory,
cli::Subcommand, collection::RequestCollection, tui::Tui,
util::data_directory,
};
use anyhow::Context;
use clap::Parser;
Expand Down
4 changes: 2 additions & 2 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub use error::{ChainError, TemplateError, TemplateResult};
pub use prompt::{Prompt, Prompter};

use crate::{
config::{Chain, ChainSource, RequestRecipeId},
collection::{Chain, ChainSource, RequestRecipeId},
http::{ContentType, Json, Repository},
util::ResultExt,
};
Expand Down Expand Up @@ -449,7 +449,7 @@ impl<'a> TemplateSource<'a> for EnvironmentTemplateSource<'a> {
mod tests {
use super::*;
use crate::{
config::RequestRecipeId,
collection::RequestRecipeId,
factory::*,
http::{Request, Response},
util::assert_err,
Expand Down
2 changes: 1 addition & 1 deletion src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod message;
mod view;

use crate::{
config::{ProfileId, RequestCollection, RequestRecipeId},
collection::{ProfileId, RequestCollection, RequestRecipeId},
http::{HttpEngine, Repository, RequestBuilder},
template::{Prompter, TemplateChunk, TemplateContext, TemplateString},
tui::{
Expand Down
2 changes: 1 addition & 1 deletion src/tui/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! state updates.
use crate::{
config::{ProfileId, RequestCollection, RequestRecipeId},
collection::{ProfileId, RequestCollection, RequestRecipeId},
http::{RequestBuildError, RequestError, RequestId, RequestRecord},
template::{Prompt, Prompter, TemplateChunk, TemplateString},
util::ResultExt,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub use state::RequestState;
pub use util::PreviewPrompter;

use crate::{
config::{RequestCollection, RequestRecipeId},
collection::{RequestCollection, RequestRecipeId},
tui::{
input::{Action, InputEngine},
message::MessageSender,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use modal::{IntoModal, Modal, ModalPriority};
pub use root::Root;

use crate::{
config::RequestRecipeId,
collection::RequestRecipeId,
tui::{
input::{Action, InputEngine},
message::{Message, MessageSender},
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/component/primary.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Components for the "primary" view, which is the paned request/response view
use crate::{
config::{Profile, RequestCollection, RequestRecipe},
collection::{Profile, RequestCollection, RequestRecipe},
tui::{
input::Action,
message::Message,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/component/request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
config::{ProfileId, RequestRecipe, RequestRecipeId},
collection::{ProfileId, RequestRecipe, RequestRecipeId},
template::TemplateString,
tui::{
input::Action,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/component/root.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
config::{RequestCollection, RequestRecipeId},
collection::{RequestCollection, RequestRecipeId},
tui::{
input::Action,
message::Message,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/component/template_preview.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
config::ProfileId,
collection::ProfileId,
template::{TemplateChunk, TemplateString},
tui::{
message::Message,
Expand Down
2 changes: 1 addition & 1 deletion src/tui/view/util.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Helper structs and functions for building components
use crate::{
config::{Profile, RequestRecipe},
collection::{Profile, RequestRecipe},
http::{RequestBuildError, RequestError},
template::{Prompt, Prompter},
tui::view::{
Expand Down

0 comments on commit d7ffce5

Please sign in to comment.