From 0f3133bf16b0eda50cce67a0539fd596a3bd54d3 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 3 Sep 2022 17:26:42 +0200 Subject: [PATCH] Rename prompts and stuff to ame prompt Signed-off-by: trivernis --- src/interact/macros.rs | 8 ++++---- src/interact/mod.rs | 4 ++-- src/interact/multi_select.rs | 6 +++--- src/interact/prompt.rs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/interact/macros.rs b/src/interact/macros.rs index 5804803..544f777 100644 --- a/src/interact/macros.rs +++ b/src/interact/macros.rs @@ -2,13 +2,13 @@ /// Macro for prompting the user with a yes/no question. macro_rules! prompt { (default yes, $($arg:tt)+) => { - $crate::interact::Interact::interact($crate::interact::Prompt::new(format!($($arg)+)).default_yes()) + $crate::interact::Interact::interact($crate::interact::AmePrompt::new(format!($($arg)+)).default_yes()) }; (default no, $($arg:tt)+) => { - $crate::interact::Interact::interact($crate::interact::Prompt::new(format!($($arg)+)).default_no()) + $crate::interact::Interact::interact($crate::interact::AmePrompt::new(format!($($arg)+)).default_no()) }; (no default, $($arg:tt)+) => { - $crate::interact::Interact::interact($crate::interact::Prompt::new(format!($($arg)+))) + $crate::interact::Interact::interact($crate::interact::AmePrompt::new(format!($($arg)+))) } } @@ -16,6 +16,6 @@ macro_rules! prompt { /// Macro for prompting the user with a multi select macro_rules! multi_select { ($items:expr, $($arg:tt)+) => { - $crate::interact::Interact::interact($crate::interact::MultiSelect::new(format!($($arg)+)).items($items)) + $crate::interact::Interact::interact($crate::interact::AmeMultiSelect::new(format!($($arg)+)).items($items)) } } diff --git a/src/interact/mod.rs b/src/interact/mod.rs index 383ddd7..a48be3d 100644 --- a/src/interact/mod.rs +++ b/src/interact/mod.rs @@ -3,8 +3,8 @@ mod multi_select; mod prompt; mod theme; -pub use multi_select::MultiSelect; -pub use prompt::Prompt; +pub use multi_select::AmeMultiSelect; +pub use prompt::AmePrompt; pub trait Interact { type Result; diff --git a/src/interact/multi_select.rs b/src/interact/multi_select.rs index ea3055c..d656c46 100644 --- a/src/interact/multi_select.rs +++ b/src/interact/multi_select.rs @@ -4,12 +4,12 @@ use crate::logging::get_logger; use super::{theme::AmeTheme, Interact}; -pub struct MultiSelect { +pub struct AmeMultiSelect { prompt: String, items: Vec, } -impl MultiSelect { +impl AmeMultiSelect { /// Creates a new multi select prompt pub fn new(prompt: S) -> Self { Self { @@ -26,7 +26,7 @@ impl MultiSelect { } } -impl Interact for MultiSelect { +impl Interact for AmeMultiSelect { type Result = Vec; fn interact(&mut self) -> Self::Result { diff --git a/src/interact/prompt.rs b/src/interact/prompt.rs index f9b14fa..64fb768 100644 --- a/src/interact/prompt.rs +++ b/src/interact/prompt.rs @@ -4,12 +4,12 @@ use crate::logging::get_logger; use super::{theme::AmeTheme, Interact}; -pub struct Prompt { +pub struct AmePrompt { question: String, default_yes: Option, } -impl Prompt { +impl AmePrompt { /// Creates a new prompt pub fn new(question: Q) -> Self { Self { @@ -33,7 +33,7 @@ impl Prompt { } } -impl Interact for Prompt { +impl Interact for AmePrompt { type Result = bool; fn interact(&mut self) -> Self::Result {