Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Nov 28, 2024
1 parent 7d98717 commit 73efdfe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ mod tl_shard {
shard.write_to(packet);
}
pub fn read(packet: &[u8], offset: &mut usize) -> tl_proto::TlResult<u64> {
let shard = u64::read_from(packet, offset)?;
pub fn read(packet: &mut &[u8]) -> tl_proto::TlResult<u64> {
let shard = u64::read_from(packet)?;
if shard % 10000 == 0 {
Ok(shard)
} else {
Expand Down
2 changes: 1 addition & 1 deletion scheme/src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ impl<'a, R: Repr> TlRead<'a> for RawBytes<'a, R> {

fn read_from(packet: &mut &'a [u8]) -> TlResult<Self> {
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))
Expand Down

0 comments on commit 73efdfe

Please sign in to comment.