Skip to content

Commit 787c34a

Browse files
committed
Fix some Clippy warnings on its default level
1 parent 4712a77 commit 787c34a

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

lib/grammers-client/src/client/chats.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ impl ProfilePhotoIter {
293293
iter.request.offset += photos.len() as i32;
294294
}
295295

296-
iter.buffer
297-
.extend(photos.into_iter().map(|x| Photo::from_raw(x)));
296+
iter.buffer.extend(photos.into_iter().map(Photo::from_raw));
298297

299298
Ok(total)
300299
}

lib/grammers-client/src/client/updates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl Client {
182182
continue;
183183
}
184184

185-
let sleep = pin!(async { sleep_until(deadline.into()).await });
185+
let sleep = pin!(async { sleep_until(deadline).await });
186186
let step = pin!(async { self.step().await });
187187

188188
match select(sleep, step).await {

lib/grammers-mtsender/src/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl Timeout {
7272
pub async fn sleep(duration: Duration) {
7373
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
7474
{
75-
return tokio::time::sleep(duration).await;
75+
tokio::time::sleep(duration).await;
7676
}
7777
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
7878
{
@@ -84,7 +84,7 @@ pub async fn sleep(duration: Duration) {
8484
pub async fn sleep_until(deadline: Instant) {
8585
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
8686
{
87-
return tokio::time::sleep_until(deadline.into()).await;
87+
tokio::time::sleep_until(deadline.into()).await;
8888
}
8989
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
9090
{

lib/grammers-session/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl Session {
169169
}
170170

171171
pub fn get_dcs(&self) -> Vec<enums::DataCenter> {
172-
self.session.lock().unwrap().dcs.iter().cloned().collect()
172+
self.session.lock().unwrap().dcs.to_vec()
173173
}
174174

175175
#[must_use]

0 commit comments

Comments
 (0)