diff --git a/rrule-afl-fuzz/src/take_data.rs b/rrule-afl-fuzz/src/take_data.rs index ec43798..29920f8 100644 --- a/rrule-afl-fuzz/src/take_data.rs +++ b/rrule-afl-fuzz/src/take_data.rs @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return u8::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return i8::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return i16::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return i32::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return i64::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return u16::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return u32::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return u64::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return usize::default(); } @@ -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::(); + let byte_len = size_of::(); if input.len() < byte_len { return isize::default(); } diff --git a/rrule/src/parser/content_line/date_content_line.rs b/rrule/src/parser/content_line/date_content_line.rs index 6cb401e..36b0d65 100644 --- a/rrule/src/parser/content_line/date_content_line.rs +++ b/rrule/src/parser/content_line/date_content_line.rs @@ -31,7 +31,7 @@ impl FromStr for DateParameter { } } -impl<'a> TryFrom> for Vec> { +impl TryFrom> for Vec> { type Error = ParseError; fn try_from(value: ContentLineCaptures) -> Result { diff --git a/rrule/src/parser/content_line/rule_content_line.rs b/rrule/src/parser/content_line/rule_content_line.rs index c394ebc..1b923ab 100644 --- a/rrule/src/parser/content_line/rule_content_line.rs +++ b/rrule/src/parser/content_line/rule_content_line.rs @@ -62,7 +62,7 @@ impl FromStr for RRuleProperty { } } -impl<'a> TryFrom> for RRule { +impl TryFrom> for RRule { type Error = ParseError; fn try_from(value: ContentLineCaptures) -> Result { diff --git a/rrule/src/parser/content_line/start_date_content_line.rs b/rrule/src/parser/content_line/start_date_content_line.rs index fdc32c3..f2ab8c0 100644 --- a/rrule/src/parser/content_line/start_date_content_line.rs +++ b/rrule/src/parser/content_line/start_date_content_line.rs @@ -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 {