mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
chore: clean up compile warnings
This commit is contained in:
parent
16ce67e02c
commit
89d6481ddb
16 changed files with 37 additions and 32 deletions
|
|
@ -15,7 +15,6 @@ futures = { workspace = true }
|
|||
reqwest = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
sqlx = { workspace = true }
|
||||
time = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
uuid = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
mod hash;
|
||||
mod migrate;
|
||||
// mod migrate;
|
||||
mod process;
|
||||
mod pull;
|
||||
mod store;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use image::{DynamicImage, ImageFormat};
|
||||
use std::borrow::Cow;
|
||||
use std::io::Cursor;
|
||||
use time::Instant;
|
||||
use std::time::Instant;
|
||||
use tracing::{debug, error, info, instrument};
|
||||
|
||||
use crate::{hash::Hash, ImageKind, PKAvatarError};
|
||||
|
|
@ -100,10 +100,10 @@ pub fn process(data: &[u8], kind: ImageKind) -> Result<ProcessOutput, PKAvatarEr
|
|||
"{}: lossy size {}K (parse: {} ms, decode: {} ms, resize: {} ms, encode: {} ms)",
|
||||
encoded.hash,
|
||||
encoded.data.len() / 1024,
|
||||
(time_after_parse - time_before).whole_milliseconds(),
|
||||
(time_after_decode - time_after_parse).whole_milliseconds(),
|
||||
(time_after_resize - time_after_decode).whole_milliseconds(),
|
||||
(time_after - time_after_resize).whole_milliseconds(),
|
||||
(time_after_parse - time_before).as_millis(),
|
||||
(time_after_decode - time_after_parse).as_millis(),
|
||||
(time_after_resize - time_after_decode).as_millis(),
|
||||
(time_after - time_after_resize).as_millis(),
|
||||
);
|
||||
|
||||
debug!(
|
||||
|
|
@ -198,7 +198,7 @@ fn process_gif_inner(
|
|||
hash,
|
||||
original_data.buffer().len() / 1024,
|
||||
data.len() / 1024,
|
||||
(time_after - time_before).whole_milliseconds(),
|
||||
(time_after - time_before).as_millis(),
|
||||
frame_count
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
use std::time::Duration;
|
||||
use std::{str::FromStr, sync::Arc};
|
||||
|
||||
use crate::PKAvatarError;
|
||||
use anyhow::Context;
|
||||
use reqwest::{Client, ClientBuilder, StatusCode, Url};
|
||||
use time::Instant;
|
||||
use reqwest::{Client, StatusCode, Url};
|
||||
use std::time::Instant;
|
||||
use tracing::{error, instrument};
|
||||
|
||||
const MAX_SIZE: u64 = 8 * 1024 * 1024;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct PullResult {
|
||||
pub data: Vec<u8>,
|
||||
pub content_type: String,
|
||||
|
|
@ -85,16 +85,16 @@ pub async fn pull(
|
|||
"{}: {} (headers: {}ms, body: {}ms)",
|
||||
status,
|
||||
&trimmed_url,
|
||||
headers_time.whole_milliseconds(),
|
||||
body_time.whole_milliseconds()
|
||||
headers_time.as_millis(),
|
||||
body_time.as_millis()
|
||||
);
|
||||
} else {
|
||||
tracing::info!(
|
||||
"{}: {} (headers: {}ms, body: {}ms)",
|
||||
status,
|
||||
&trimmed_url,
|
||||
headers_time.whole_milliseconds(),
|
||||
body_time.whole_milliseconds()
|
||||
headers_time.as_millis(),
|
||||
body_time.as_millis()
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -105,6 +105,7 @@ pub async fn pull(
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
pub struct ParsedUrl {
|
||||
pub channel_id: u64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue