cargo fmt

This commit is contained in:
ayaka 2025-01-17 23:05:53 +13:00
parent 05e2c31bec
commit 4c516a7d57
6 changed files with 12 additions and 14 deletions

View File

@ -7,7 +7,7 @@ use hyper::header::HeaderValue;
use hyper::{body, body::Buf, header, Body, Client, Method, Request, Response, Uri};
use hyper_rustls::HttpsConnector;
use libflate::gzip;
use log::{error, debug, warn};
use log::{debug, error, warn};
use once_cell::sync::Lazy;
use percent_encoding::{percent_encode, CONTROLS};
use serde_json::Value;

View File

@ -13,7 +13,7 @@ use log::info;
use once_cell::sync::Lazy;
use redsunlib::client::{canonical_path, proxy, CLIENT};
use redsunlib::server::{self, RequestExt};
use redsunlib::utils::{error, redirect, ThemeAssets, MascotAssets};
use redsunlib::utils::{error, redirect, MascotAssets, ThemeAssets};
use redsunlib::{config, duplicates, headers, instance_info, post, search, settings, subreddit, user};
use redsunlib::client::OAUTH_CLIENT;
@ -110,8 +110,7 @@ async fn style() -> Result<Response<Body>, String> {
/// Serve mascot
async fn mascot_image(req: Request<Body>) -> Result<Response<Body>, String> {
let res = MascotAssets::get(&req.param("name").unwrap())
.unwrap_or(MascotAssets::get("redsunlib.png").unwrap());
let res = MascotAssets::get(&req.param("name").unwrap()).unwrap_or(MascotAssets::get("redsunlib.png").unwrap());
Ok(
Response::builder()
.status(200)

View File

@ -6,7 +6,7 @@ use crate::{
};
use base64::{engine::general_purpose, Engine as _};
use hyper::{client, Body, Method, Request};
use log::{error, info, debug, trace};
use log::{debug, error, info, trace};
use serde_json::json;
use tokio::time::{error::Elapsed, timeout};

View File

@ -12,7 +12,7 @@ use rinja::Template;
use once_cell::sync::Lazy;
use regex::Regex;
use time::{Duration, OffsetDateTime,macros::format_description};
use time::{macros::format_description, Duration, OffsetDateTime};
use log::trace;
@ -302,7 +302,6 @@ pub async fn subscriptions_filters_quicklists(req: Request<Body>) -> Result<Resp
// Remove sub name from filtered list
quicklist.retain(|s| s.to_lowercase() != part.to_lowercase());
}
}
// Redirect back to subreddit

View File

@ -6,9 +6,9 @@ use crate::server::RequestExt;
use crate::utils::{error, filter_posts, format_url, get_filters, nsfw_landing, param, setting, template, Post, Preferences, User};
use crate::{config, utils};
use hyper::{Body, Request, Response};
use log::trace;
use rinja::Template;
use time::{macros::format_description, OffsetDateTime};
use log::trace;
// STRUCTS
#[derive(Template)]