summaryrefslogtreecommitdiffstats
path: root/src/repl
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-09 08:11:38 +0800
committersigoden <sigoden@gmail.com>2023-03-09 08:15:14 +0800
commite78b5f7c58fa3b6dff71042da2bbf6003c78184d (patch)
tree6cd92751a565e6e5ddc1907171a67326037cea13 /src/repl
parent1ec451da896f930829d8908da81e416d891f9aa5 (diff)
downloadaichat-e78b5f7c58fa3b6dff71042da2bbf6003c78184d.tar.gz
refactor: imports order and group
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/handler.rs4
-rw-r--r--src/repl/init.rs3
-rw-r--r--src/repl/mod.rs6
3 files changed, 6 insertions, 7 deletions
diff --git a/src/repl/handler.rs b/src/repl/handler.rs
index 6a7fc93..1b2eb20 100644
--- a/src/repl/handler.rs
+++ b/src/repl/handler.rs
@@ -3,13 +3,13 @@ use crate::config::SharedConfig;
use crate::print_now;
use crate::render::render_stream;
+use super::abort::SharedAbortSignal;
+
use anyhow::{Context, Result};
use crossbeam::channel::Sender;
use crossbeam::sync::WaitGroup;
use std::cell::RefCell;
-use super::abort::SharedAbortSignal;
-
pub enum ReplCmd {
Submit(String),
SetRole(String),
diff --git a/src/repl/init.rs b/src/repl/init.rs
index 88f66fa..14dbd9c 100644
--- a/src/repl/init.rs
+++ b/src/repl/init.rs
@@ -1,4 +1,5 @@
use super::Repl;
+use super::REPL_COMMANDS;
use crate::config::{Config, SharedConfig};
@@ -9,8 +10,6 @@ use reedline::{
ReedlineMenu, ValidationResult, Validator,
};
-use super::REPL_COMMANDS;
-
const MENU_NAME: &str = "completion_menu";
impl Repl {
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 4825b93..b5fee57 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -2,6 +2,9 @@ mod abort;
mod handler;
mod init;
+pub use self::abort::*;
+pub use self::handler::*;
+
use crate::client::ChatGptClient;
use crate::config::SharedConfig;
use crate::print_now;
@@ -11,9 +14,6 @@ use anyhow::{Context, Result};
use reedline::{DefaultPrompt, Reedline, Signal};
use std::sync::Arc;
-pub use self::abort::*;
-pub use self::handler::*;
-
pub const REPL_COMMANDS: [(&str, &str, bool); 10] = [
(".info", "Print the information", false),
(".set", "Modify the configuration temporarily", false),