Since with_prompt was shared between all prompts, it is more idiomatic to have it in the constructor.
IZ67IMRIPBOYLOAR5WE5NYA7MHOT7TXXEE7WM63MU4JSH6OM7YQQC EKXWNEPK4FTYKT2RJL2L7HTM64VQGDD3DYD6NZIDGMMV6ITHUVZAC JUV7C6ET4ZQJNLO7B4JB7XMLV2YUBZB4ARJHN4JEPHDGGBWGLEVAC 7YOM2QEFZ5HWVEISP3VIR2GKF2NNH4KKTLTWEMYMMWNYKICXWTZAC 3BUFFCHQHO6GJ7NQ3274OZMMOWSGGUEQJWQWQHCTYYXGEGYQGFTAC BAH2JCJPTDXAE6XGSLIPBQZU4GQY65HI66Q4XTFNL65MV6VSNF2QC RUCC2HKZZTUHN3G6IWS4NK3VYGXAI6PORJH2YZKPRAYSDWH63ESQC U2PHMYPDFQQYTPDVVJLWDJM5G45ILXLWDDDTZVV2NBOSCED323MQC QJC4IQITOQP65AFLA5CMH2EXHB6B3SOLW2XBV72U5ZQU2KOR2EIAC NEBSVXIASWSJO2CVU3VWRONIWJJDLL3VDS6WNKQBWQBRUUI7RSYAC pub(crate) fn new_from_environment(environment: &'environment InteractionEnvironment) -> Self {
pub(crate) fn new_from_environment<L: Localize>(environment: &'environment InteractionEnvironment,prompt: L,) -> Self {let localized_prompt = prompt.localize_for(&environment.locale);
pub(crate) fn new_from_environment(environment: &'environment InteractionEnvironment) -> Self {
pub(crate) fn new_from_environment<L: Localize>(environment: &'environment InteractionEnvironment,prompt: L,) -> Self {let localized_prompt = prompt.localize_for(&environment.locale);
macro_rules! impl_with_prompt {($newtype:ident) => {impl<'environment> $newtype<'environment> {pub fn with_prompt<L: l10n_embed::Localize>(mut self, prompt: L) -> Self {let localized_text = prompt.localize_for(&self.environment.locale);self.prompt = Some(localized_text);
pub(crate) fn new_from_environment(environment: &'environment InteractionEnvironment) -> Self {
pub(crate) fn new_from_environment<L: Localize>(environment: &'environment InteractionEnvironment,prompt: L,) -> Self {let localized_prompt = prompt.localize_for(&environment.locale);
pub(crate) fn new_from_environment(environment: &'environment InteractionEnvironment) -> Self {
pub(crate) fn new_from_environment<L: Localize>(environment: &'environment InteractionEnvironment,prompt: L,) -> Self {let localized_prompt = prompt.localize_for(&environment.locale);
pub fn $prompt_name<'environment>(&'environment self) -> $prompt_type<'environment> {$prompt_type::new_from_environment(self)
pub fn $prompt_name<'environment, L: Localize>(&'environment self,prompt: L,) -> $prompt_type<'environment> {$prompt_type::new_from_environment(self, prompt)
pub fn with_extension(mut self, extension: &str) -> Self {self.extension = Some(extension.to_string());
pub fn with_executable(mut self, executable: &str) -> Self {self.executable = Some(executable.to_string());
if let Some(extension) = &self.extension {editor.extension(extension);
// Dialoguer just appends the extension to the file, so add a `.` to separate iteditor.extension(&format!(".{}", self.extension));if let Some(executable) = &self.executable {editor.executable(executable);