Skip to content

Commit

Permalink
Merge pull request #131 from AlexTMjugador/chore/clippy
Browse files Browse the repository at this point in the history
Fix some new Clippy lints
  • Loading branch information
fmeringdal authored Jan 26, 2025
2 parents cde9ab5 + e00645a commit 3e8b9cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions rrule-afl-fuzz/src/take_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn take_weekday(input: &mut &[u8]) -> Weekday {
/// Uses 1 byte
/// If no bytes left it will always return default (`0`)
pub fn take_byte(input: &mut &[u8]) -> u8 {
let byte_len = std::mem::size_of::<u8>();
let byte_len = size_of::<u8>();
if input.len() < byte_len {
return u8::default();
}
Expand All @@ -119,7 +119,7 @@ pub fn take_data_u8(input: &mut &[u8]) -> u8 {
/// Uses 1 byte
/// If no bytes left it will always return default (`0`)
pub fn take_data_i8(input: &mut &[u8]) -> i8 {
let byte_len = std::mem::size_of::<i8>();
let byte_len = size_of::<i8>();
if input.len() < byte_len {
return i8::default();
}
Expand All @@ -131,7 +131,7 @@ pub fn take_data_i8(input: &mut &[u8]) -> i8 {
/// Uses 2 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_i16(input: &mut &[u8]) -> i16 {
let byte_len = std::mem::size_of::<i16>();
let byte_len = size_of::<i16>();
if input.len() < byte_len {
return i16::default();
}
Expand All @@ -143,7 +143,7 @@ pub fn take_data_i16(input: &mut &[u8]) -> i16 {
/// Uses 4 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_i32(input: &mut &[u8]) -> i32 {
let byte_len = std::mem::size_of::<i32>();
let byte_len = size_of::<i32>();
if input.len() < byte_len {
return i32::default();
}
Expand All @@ -155,7 +155,7 @@ pub fn take_data_i32(input: &mut &[u8]) -> i32 {
/// Uses 8 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_i64(input: &mut &[u8]) -> i64 {
let byte_len = std::mem::size_of::<i64>();
let byte_len = size_of::<i64>();
if input.len() < byte_len {
return i64::default();
}
Expand All @@ -167,7 +167,7 @@ pub fn take_data_i64(input: &mut &[u8]) -> i64 {
/// Uses 2 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_u16(input: &mut &[u8]) -> u16 {
let byte_len = std::mem::size_of::<u16>();
let byte_len = size_of::<u16>();
if input.len() < byte_len {
return u16::default();
}
Expand All @@ -179,7 +179,7 @@ pub fn take_data_u16(input: &mut &[u8]) -> u16 {
/// Uses 4 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_u32(input: &mut &[u8]) -> u32 {
let byte_len = std::mem::size_of::<u32>();
let byte_len = size_of::<u32>();
if input.len() < byte_len {
return u32::default();
}
Expand All @@ -191,7 +191,7 @@ pub fn take_data_u32(input: &mut &[u8]) -> u32 {
/// Uses 8 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_u64(input: &mut &[u8]) -> u64 {
let byte_len = std::mem::size_of::<u64>();
let byte_len = size_of::<u64>();
if input.len() < byte_len {
return u64::default();
}
Expand All @@ -203,7 +203,7 @@ pub fn take_data_u64(input: &mut &[u8]) -> u64 {
/// Uses max 8 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_usize(input: &mut &[u8]) -> usize {
let byte_len = std::mem::size_of::<usize>();
let byte_len = size_of::<usize>();
if input.len() < byte_len {
return usize::default();
}
Expand All @@ -215,7 +215,7 @@ pub fn take_data_usize(input: &mut &[u8]) -> usize {
/// Uses max 8 bytes
/// If no bytes left it will always return default (`0`)
pub fn take_data_isize(input: &mut &[u8]) -> isize {
let byte_len = std::mem::size_of::<isize>();
let byte_len = size_of::<isize>();
if input.len() < byte_len {
return isize::default();
}
Expand Down
2 changes: 1 addition & 1 deletion rrule/src/parser/content_line/date_content_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl FromStr for DateParameter {
}
}

impl<'a> TryFrom<ContentLineCaptures<'a>> for Vec<chrono::DateTime<Tz>> {
impl TryFrom<ContentLineCaptures<'_>> for Vec<chrono::DateTime<Tz>> {
type Error = ParseError;

fn try_from(value: ContentLineCaptures) -> Result<Self, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion rrule/src/parser/content_line/rule_content_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl FromStr for RRuleProperty {
}
}

impl<'a> TryFrom<ContentLineCaptures<'a>> for RRule<Unvalidated> {
impl TryFrom<ContentLineCaptures<'_>> for RRule<Unvalidated> {
type Error = ParseError;

fn try_from(value: ContentLineCaptures) -> Result<Self, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion rrule/src/parser/content_line/start_date_content_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) struct StartDateContentLine {
pub value: &'static str,
}

impl<'a> TryFrom<&ContentLineCaptures<'a>> for StartDateContentLine {
impl TryFrom<&ContentLineCaptures<'_>> for StartDateContentLine {
type Error = ParseError;

fn try_from(content_line: &ContentLineCaptures) -> Result<Self, Self::Error> {
Expand Down

0 comments on commit 3e8b9cc

Please sign in to comment.