style: 清空 clippy 提示

This commit is contained in:
amtoaer
2025-01-11 23:36:59 +08:00
parent 0113bf704d
commit 368b9ef735
4 changed files with 14 additions and 13 deletions
+11 -10
View File
@@ -69,17 +69,18 @@ pub struct BiliClient {
impl BiliClient {
pub fn new() -> Self {
let client = Client::new();
let limiter = match CONFIG.concurrent_limit.rate_limit {
Some(RateLimit { limit, duration }) => Some(
let limiter = CONFIG
.concurrent_limit
.rate_limit
.as_ref()
.map(|RateLimit { limit, duration }| {
RateLimiter::builder()
.initial(limit)
.refill(limit)
.max(limit)
.interval(Duration::from_secs(duration))
.build(),
),
None => None,
};
.initial(*limit)
.refill(*limit)
.max(*limit)
.interval(Duration::from_secs(*duration))
.build()
});
Self { client, limiter }
}
+1 -1
View File
@@ -130,7 +130,7 @@ impl<'a> Video<'a> {
.error_for_status()?;
let headers = std::mem::take(res.headers_mut());
let content_type = headers.get("content-type");
if !content_type.is_some_and(|v| v == "application/octet-stream") {
if content_type.is_none_or(|v| v != "application/octet-stream") {
bail!(
"unexpected content type: {:?}, body: {:?}",
content_type,