Skip to content

Commit 65ccaff

Browse files
committed
refactor(clippy): fix warnings
1 parent 4b97aee commit 65ccaff

File tree

8 files changed

+11
-9
lines changed

8 files changed

+11
-9
lines changed

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tox_core = { version = "0.1.1", path = "../tox_core" }
1212

1313
log = "0.4"
1414
futures = { version = "0.3", default-features = false, features = ["std", "async-await"] }
15-
env_logger = "0.7"
15+
env_logger = "0.8"
1616
hex = "0.4"
1717
failure = "0.1"
1818

tox_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ get_if_addrs = "0.5"
3030
failure = "0.1"
3131
lru = "0.6"
3232
bitflags = "1.0"
33-
itertools = "0.9"
33+
itertools = "0.10"
3434

3535
[dependencies.tokio]
3636
version = "1.0"

tox_core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Repo: https://github.com/tox-rs/tox
99
#![forbid(unsafe_code)]
1010
#![doc(html_logo_url = "https://raw.githubusercontent.com/tox-rs/logo/master/logo.png")]
1111
// Remove it when it will be fixed in nom parser
12-
#![allow(clippy::redundant_closure)]
12+
#![allow(clippy::redundant_closure, clippy::result_unit_err)]
1313

1414
#[macro_use]
1515
extern crate log;

tox_core/src/net_crypto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ impl NetCrypto {
885885
connection.packets_received += 1;
886886
self.process_ready_lossless_packets(&mut connection.recv_array, connection.peer_real_pk).await
887887
.map_err(|e| e.context(HandlePacketErrorKind::SendToLossless))?;
888-
} else if packet_id >= PACKET_ID_LOSSY_RANGE_START && packet_id <= PACKET_ID_LOSSY_RANGE_END {
888+
} else if (PACKET_ID_LOSSY_RANGE_START..=PACKET_ID_LOSSY_RANGE_END).contains(&packet_id) {
889889
// Update end index of received buffer ignoring the error - we still
890890
// want to handle this packet even if connection is too slow
891891
connection.recv_array.set_buffer_end(payload.packet_number).ok();

tox_core/src/onion/client/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ impl OnionClient {
633633
}
634634

635635
/// Generic function for sending search and announce requests to close nodes.
636-
async fn ping_close_nodes<'a>(
636+
async fn ping_close_nodes(
637637
&self,
638638
close_nodes: &mut Kbucket<OnionNode>,
639639
paths_pool: &mut PathsPool,
640640
announce_requests: &mut RequestQueue<AnnounceRequestData>,
641-
announce_packet_data: AnnouncePacketData<'a>,
641+
announce_packet_data: AnnouncePacketData<'_>,
642642
friend_pk: Option<PublicKey>,
643643
interval: Option<Duration>
644644
) -> Result<bool, mpsc::SendError> {

tox_crypto/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Functions for the core crypto.
22
3+
#![allow(clippy::result_unit_err)]
4+
35
pub use sodiumoxide::randombytes::randombytes_into;
46
pub use sodiumoxide::crypto::box_::*;
57
pub use sodiumoxide::crypto::hash::{sha256, sha512};

tox_encryptsave/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ impl PassKey {
102102
103103
## Fails when:
104104
105-
* passphrase is empty
106-
* deriving key failed (can happen due to OOM)
105+
* passphrase is empty
106+
* deriving key failed (can happen due to OOM)
107107
108108
E.g.
109109

tox_packet/src/onion/onion_announce_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl FromBytes for OnionAnnounceResponsePayload {
140140
announce_status: call!(AnnounceStatus::from_bytes) >>
141141
ping_id_or_pk: call!(sha256::Digest::from_bytes) >>
142142
nodes: many0!(PackedNode::from_bytes) >>
143-
_len: verify!(value!(nodes.len()), |len| *len <= 4 as usize) >>
143+
_len: verify!(value!(nodes.len()), |len| *len <= 4_usize) >>
144144
eof!() >>
145145
(OnionAnnounceResponsePayload {
146146
announce_status,

0 commit comments

Comments
 (0)