From e78b5f7c58fa3b6dff71042da2bbf6003c78184d Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 9 Mar 2023 08:11:38 +0800 Subject: refactor: imports order and group --- src/repl/handler.rs | 4 ++-- src/repl/init.rs | 3 +-- src/repl/mod.rs | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/repl') 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), -- cgit v1.2.3