From 8c9125b4c48a08112549f1b9b411f8bfc0bd336f Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 1 Apr 2024 20:32:14 -0400 Subject: Unify import style --- src/cache.rs | 1 - src/config.rs | 6 ------ src/ctx.rs | 8 +++++--- src/deserialize.rs | 6 +++--- src/http.rs | 1 + src/main.rs | 7 +++++-- 6 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') 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; diff --git a/src/ctx.rs b/src/ctx.rs index 6e0d806..50e01bb 100644 --- a/src/ctx.rs +++ b/src/ctx.rs @@ -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 where D: Deserializer<'de>, T: From { 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 { -- cgit v1.2.3-70-g09d2