From 4424fb9b44c893dc937dc5077be7ef819680ea2c Mon Sep 17 00:00:00 2001 From: alyx Date: Wed, 3 Apr 2024 12:14:50 -0400 Subject: clippy --- src/cache/user.rs | 1 + src/config.rs | 4 ++-- src/ctx.rs | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cache/user.rs b/src/cache/user.rs index 253773c..e228cc2 100644 --- a/src/cache/user.rs +++ b/src/cache/user.rs @@ -10,6 +10,7 @@ use super::{CacheFuture, CacheGetter, Cache, AsyncCache}; use crate::deserialize::{User, Track, TrackStub}; use crate::CONFIG; +pub type UserInfo = Arc<(User, Track, TrackStub)>; type UserFuture = CacheFuture>; type UserGetter = CacheGetter>; type UserCache = Cache>; diff --git a/src/config.rs b/src/config.rs index 1a192b2..350786d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -50,8 +50,8 @@ impl Config { allowlist: var("LFME_WHITELIST").or_else(|_| var("LFME_ALLOWLIST")).ok().map(|w| w.split(',').map(|s| s.trim().to_string()).collect()).unwrap_or_default(), allowlist_mode: var("LFME_WHITELIST_MODE").or_else(|_| var("LFME_ALLOWLIST_MODE")).map(|m| m.to_ascii_lowercase()).unwrap_or_else(|_| "open".into()), - default_refresh: default_refresh, - allowlist_refresh: allowlist_refresh + default_refresh, + allowlist_refresh }) } diff --git a/src/ctx.rs b/src/ctx.rs index 6d0118e..3d14e4c 100644 --- a/src/ctx.rs +++ b/src/ctx.rs @@ -1,10 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-only -use std::sync::Arc; use std::collections::BTreeMap; use reqwest::StatusCode; -use super::deserialize as de; +use super::cache::user::UserInfo; use super::config::CONFIG; use crate::cache::font::FontQuery; @@ -107,7 +106,7 @@ pub mod model { } pub use model::Root as Ctx; -pub async fn get_ctx(api_result: Result, (StatusCode, &'static str)>, font_query: Option, query: BTreeMap) -> (Ctx, StatusCode) { +pub async fn get_ctx(api_result: Result, font_query: Option, query: BTreeMap) -> (Ctx, StatusCode) { match api_result { Ok(a) => { let (user, track, trackstub) = a.as_ref(); -- cgit v1.2.3-70-g09d2