diff options
author | alyx <alyx@aleteoryx.me> | 2024-04-01 20:32:14 -0400 |
---|---|---|
committer | alyx <alyx@aleteoryx.me> | 2024-04-01 20:32:14 -0400 |
commit | 8c9125b4c48a08112549f1b9b411f8bfc0bd336f (patch) | |
tree | d1f3b8a5ebcb6064f070ea8a8fdf9d624631bf9f | |
parent | 15a94c34407b608122a569fbda09039064e51169 (diff) | |
download | lfm_embed-8c9125b4c48a08112549f1b9b411f8bfc0bd336f.tar.gz lfm_embed-8c9125b4c48a08112549f1b9b411f8bfc0bd336f.tar.bz2 lfm_embed-8c9125b4c48a08112549f1b9b411f8bfc0bd336f.zip |
Unify import style
-rw-r--r-- | src/cache.rs | 1 | ||||
-rw-r--r-- | src/config.rs | 6 | ||||
-rw-r--r-- | src/ctx.rs | 8 | ||||
-rw-r--r-- | src/deserialize.rs | 6 | ||||
-rw-r--r-- | src/http.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 7 |
6 files changed, 14 insertions, 15 deletions
diff --git a/src/cache.rs b/src/cache.rs index cf612b6..aa06835 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -9,7 +9,6 @@ use std::sync::Arc; use std::pin::Pin; use tokio::sync::RwLock; - use reqwest::StatusCode; #[derive(Debug)] diff --git a/src/config.rs b/src/config.rs index 69328b0..b242534 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,15 +1,9 @@ use std::collections::BTreeSet; use std::sync::LazyLock; use std::sync::Arc; -use std::future::Future; -use std::pin::Pin; use std::time::*; -use super::cache::AsyncCache; -use super::deserialize::{GetRecentTracks, GetUserInfo, GetTrackInfo, Track, TrackStub, User}; - use dotenv::var; -use tokio::sync::RwLock; use handlebars::{Handlebars, handlebars_helper}; use duration_str as ds; @@ -1,9 +1,11 @@ -use reqwest::StatusCode; -use super::deserialize as de; use std::sync::Arc; use std::collections::BTreeMap; -use crate::cache::font::FontQuery; + +use reqwest::StatusCode; + +use super::deserialize as de; use super::config::CONFIG; +use crate::cache::font::FontQuery; pub mod model { use std::sync::Arc; diff --git a/src/deserialize.rs b/src/deserialize.rs index 0134ae5..4a95b70 100644 --- a/src/deserialize.rs +++ b/src/deserialize.rs @@ -1,9 +1,9 @@ -use serde::{Deserialize, Deserializer, de}; -use serde_json::Value; - use std::collections::HashMap; use std::sync::Arc; +use serde::{Deserialize, Deserializer, de}; +use serde_json::Value; + fn str_num<'de, D, T>(d: D) -> Result<T, D::Error> where D: Deserializer<'de>, T: From<u64> { struct Visitor; impl<'v> de::Visitor<'v> for Visitor { diff --git a/src/http.rs b/src/http.rs index f0a609b..e3f29e6 100644 --- a/src/http.rs +++ b/src/http.rs @@ -1,4 +1,5 @@ use std::sync::LazyLock; + use reqwest::Client; pub(crate) fn new() -> Client { diff --git a/src/main.rs b/src/main.rs index 38ee31f..d71f05c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,17 @@ #![feature(lazy_cell)] -use dotenv::var; -use log::LevelFilter; use std::collections::BTreeMap; use std::fs::File; use std::sync::Arc; + use lfm_embed::{CONFIG, ResponseCtx}; use lfm_embed::cache::font::FontQuery; + +use log::LevelFilter; +use dotenv::var; use warp::Filter; + #[derive(serde::Deserialize, Debug)] #[serde(rename = "kebab-case")] struct UserQuery { |