mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-05 15:39:07 +08:00
style: 清空 clippy 提示
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user