summaryrefslogtreecommitdiffstats
path: root/src/repl/prompt.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-11-07 10:21:17 +0800
committerGitHub <noreply@github.com>2023-11-07 10:21:17 +0800
commit87aec71e080dc9c15f3dd0059dbc91686f3de4e6 (patch)
tree962ade482812d222d0681af6e4f5de946e3c86cf /src/repl/prompt.rs
parent81624f7267ba20799a3bbf779abfe41df30d349c (diff)
downloadaichat-87aec71e080dc9c15f3dd0059dbc91686f3de4e6.tar.gz
refactor: use &GlobalConfig to avoid clone (#217)
Diffstat (limited to 'src/repl/prompt.rs')
-rw-r--r--src/repl/prompt.rs6
1 files changed, 4 insertions, 2 deletions
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(),
+ }
}
}