From a9793a14a700c73b9e4a8d9b6cc19eb6c21a24ed Mon Sep 17 00:00:00 2001 From: David Cristofaro Date: Mon, 1 May 2023 09:39:28 +1000 Subject: [PATCH] Cleanups --- src/error.rs | 1 - src/main.rs | 3 +-- src/prelude.rs | 1 + src/web/generate.rs | 5 +---- src/web/health.rs | 5 +---- 5 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 src/prelude.rs diff --git a/src/error.rs b/src/error.rs index 2526d3d..2dd3389 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,6 @@ pub enum Error { RequestError, SerializationError, DeserializationError, - MissingChoiceError, StreamError, } diff --git a/src/main.rs b/src/main.rs index 159be39..87fc49e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,10 +2,9 @@ use std::net::SocketAddr; use axum::Server; -pub use self::error::{Error, Result}; - mod env; mod error; +mod prelude; mod signal; mod web; diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 0000000..af4fb59 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1 @@ +pub use crate::error::{Error, Result}; diff --git a/src/web/generate.rs b/src/web/generate.rs index 7b6eaed..f7bd6dd 100644 --- a/src/web/generate.rs +++ b/src/web/generate.rs @@ -6,10 +6,7 @@ use futures::{StreamExt, TryStreamExt}; use reqwest::{header, Client}; use serde::{Deserialize, Serialize}; -use crate::{ - env, - error::{Error, Result}, -}; +use crate::{env, prelude::*}; #[derive(Debug, Serialize)] struct ChatCompletionsBody { diff --git a/src/web/health.rs b/src/web/health.rs index f90e4fa..bcafc91 100644 --- a/src/web/health.rs +++ b/src/web/health.rs @@ -3,10 +3,7 @@ use std::time::SystemTime; use axum::{response::IntoResponse, Json}; use serde::Serialize; -use crate::{ - env, - error::{Error, Result}, -}; +use crate::{env, prelude::*}; #[derive(Debug, Serialize)] struct HealthBody {