~aleteoryx/lfm_embed

8c9125b4c48a08112549f1b9b411f8bfc0bd336f — alyx 8 months ago 15a94c3
Unify import style
6 files changed, 14 insertions(+), 15 deletions(-)

M src/cache.rs
M src/config.rs
M src/ctx.rs
M src/deserialize.rs
M src/http.rs
M src/main.rs
M src/cache.rs => src/cache.rs +0 -1
@@ 9,7 9,6 @@ use std::sync::Arc;
use std::pin::Pin;

use tokio::sync::RwLock;

use reqwest::StatusCode;

#[derive(Debug)]

M src/config.rs => src/config.rs +0 -6
@@ 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;


M src/ctx.rs => src/ctx.rs +5 -3
@@ 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;

M src/deserialize.rs => src/deserialize.rs +3 -3
@@ 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 {

M src/http.rs => src/http.rs +1 -0
@@ 1,4 1,5 @@
use std::sync::LazyLock;

use reqwest::Client;

pub(crate) fn new() -> Client {

M src/main.rs => src/main.rs +5 -2
@@ 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 {