diff options
Diffstat (limited to 'src/repl')
| -rw-r--r-- | src/repl/mod.rs | 10 | ||||
| -rw-r--r-- | src/repl/prompt.rs | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 818a86a..4f51020 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -60,17 +60,17 @@ pub struct Repl { } impl Repl { - pub fn init(config: GlobalConfig) -> Result<Self> { - let editor = Self::create_editor(&config)?; + pub fn init(config: &GlobalConfig) -> Result<Self> { + let editor = Self::create_editor(config)?; - let prompt = ReplPrompt::new(config.clone()); + let prompt = ReplPrompt::new(config); let abort = create_abort_signal(); let clipboard = Clipboard::new().map(RefCell::new); Ok(Self { - config, + config: config.clone(), editor, prompt, clipboard, @@ -228,7 +228,7 @@ impl Repl { } self.config.read().maybe_print_send_tokens(input); let wg = WaitGroup::new(); - let client = init_client(self.config.clone())?; + let client = init_client(&self.config)?; let ret = render_stream( input, client.as_ref(), diff --git a/src/repl/prompt.rs b/src/repl/prompt.rs index b4c9099..827f84d 100644 --- a/src/repl/prompt.rs +++ b/src/repl/prompt.rs @@ -15,8 +15,10 @@ pub struct ReplPrompt { } impl ReplPrompt { - pub fn new(config: GlobalConfig) -> Self { - Self { config } + pub fn new(config: &GlobalConfig) -> Self { + Self { + config: config.clone(), + } } } |
