diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-06 07:08:51 +0800 |
|---|---|---|
| committer | sigoden <sigoden@gmail.com> | 2023-03-06 07:08:51 +0800 |
| commit | c5a2f4603c3c3eb7995f4e77453ab8ca50ff88b8 (patch) | |
| tree | 16c394645144c2dd102327d08d8c5bdcc7ae3f7b /src/repl/mod.rs | |
| parent | 2152667fc6551129fd0bb14ca9e403728855aea3 (diff) | |
| download | aichat-c5a2f4603c3c3eb7995f4e77453ab8ca50ff88b8.tar.gz | |
chore: optimize code
Diffstat (limited to 'src/repl/mod.rs')
| -rw-r--r-- | src/repl/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 6aeb233..30f09fe 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -1,6 +1,8 @@ mod handler; mod init; +use crate::client::ChatGptClient; +use crate::config::SharedConfig; use crate::term; use crate::utils::{copy, dump}; @@ -32,7 +34,8 @@ pub struct Repl { } impl Repl { - pub fn run(&mut self, handler: ReplCmdHandler) -> Result<()> { + pub fn run(&mut self, client: ChatGptClient, config: SharedConfig) -> Result<()> { + let handler = ReplCmdHandler::init(client, config)?; dump( format!("Welcome to aichat {}", env!("CARGO_PKG_VERSION")), 1, |
