diff --git a/README.md b/README.md index 5f1c8ca..52f89ba 100644 --- a/README.md +++ b/README.md @@ -143,8 +143,8 @@ mod tl_shard { shard.write_to(packet); } - pub fn read(packet: &[u8], offset: &mut usize) -> tl_proto::TlResult { - let shard = u64::read_from(packet, offset)?; + pub fn read(packet: &mut &[u8]) -> tl_proto::TlResult { + let shard = u64::read_from(packet)?; if shard % 10000 == 0 { Ok(shard) } else { diff --git a/scheme/src/tokens.rs b/scheme/src/tokens.rs index dace7db..b7ee645 100644 --- a/scheme/src/tokens.rs +++ b/scheme/src/tokens.rs @@ -164,7 +164,7 @@ pub struct Constructor<'a> { pub output: OutputType<'a>, } -impl<'a> Constructor<'a> { +impl Constructor<'_> { pub fn as_normalized(&self) -> String { NormalizedConstructor(self).to_string() } diff --git a/src/hasher.rs b/src/hasher.rs index d398ec1..5906b1a 100644 --- a/src/hasher.rs +++ b/src/hasher.rs @@ -71,7 +71,7 @@ where struct HashWriter<'a>(pub &'a mut dyn Hasher); -impl<'a> TlPacket for HashWriter<'a> { +impl TlPacket for HashWriter<'_> { #[inline(always)] fn ignore_signature(&self) -> bool { true diff --git a/src/seq.rs b/src/seq.rs index 7d72021..7364e06 100644 --- a/src/seq.rs +++ b/src/seq.rs @@ -547,7 +547,7 @@ impl<'a, R: Repr> TlRead<'a> for RawBytes<'a, R> { fn read_from(packet: &mut &'a [u8]) -> TlResult { let result = *packet; - // NOTE: Assign the end of the packet instead of just empty slice to + // NOTE: Assign the end of the packet instead of just empty slice // to leave the pointer at the same location. *packet = &packet[packet.len()..]; Ok(Self::new(result))