diff options
| author | sigoden <sigoden@gmail.com> | 2023-11-07 10:21:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-07 10:21:17 +0800 |
| commit | 87aec71e080dc9c15f3dd0059dbc91686f3de4e6 (patch) | |
| tree | 962ade482812d222d0681af6e4f5de946e3c86cf /src/repl/prompt.rs | |
| parent | 81624f7267ba20799a3bbf779abfe41df30d349c (diff) | |
| download | aichat-87aec71e080dc9c15f3dd0059dbc91686f3de4e6.tar.gz | |
refactor: use &GlobalConfig to avoid clone (#217)
Diffstat (limited to 'src/repl/prompt.rs')
| -rw-r--r-- | src/repl/prompt.rs | 6 |
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(), + } } } |
