diff --git a/Cargo.toml b/Cargo.toml index 73f71433..e4d1111a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ edition = "2024" homepage = "https://aya-rs.dev" license = "MIT OR Apache-2.0" repository = "https://github.com/aya-rs/aya" -rust-version = "1.85.0" +rust-version = "1.87.0" # NOTE(vadorovsky): Neither cargo-udeps nor cargo-machete are able to detect # unused crates defined in this section. It would be nice to teach either of diff --git a/aya-obj/src/obj.rs b/aya-obj/src/obj.rs index b451595a..c3d0d107 100644 --- a/aya-obj/src/obj.rs +++ b/aya-obj/src/obj.rs @@ -1404,7 +1404,7 @@ pub fn parse_map_info(info: bpf_map_info, pinned: PinningType) -> Map { /// Copies a block of eBPF instructions pub fn copy_instructions(data: &[u8]) -> Result, ParseError> { - if data.len() % mem::size_of::() > 0 { + if !data.len().is_multiple_of(mem::size_of::()) { return Err(ParseError::InvalidProgramCode); } let instructions = data diff --git a/aya-obj/src/relocation.rs b/aya-obj/src/relocation.rs index 850eaaa3..d035339b 100644 --- a/aya-obj/src/relocation.rs +++ b/aya-obj/src/relocation.rs @@ -202,7 +202,7 @@ fn relocate_maps<'a, I: Iterator>( // make sure that the relocation offset is properly aligned let ins_offset = rel_offset - section_offset; - if ins_offset % INS_SIZE != 0 { + if !ins_offset.is_multiple_of(INS_SIZE) { return Err(RelocationError::InvalidRelocationOffset { offset: rel.offset, relocation_number: rel_n, diff --git a/test/integration-ebpf/src/ring_buf.rs b/test/integration-ebpf/src/ring_buf.rs index b6f12ac1..cac357f5 100644 --- a/test/integration-ebpf/src/ring_buf.rs +++ b/test/integration-ebpf/src/ring_buf.rs @@ -40,7 +40,7 @@ fn ring_buf_test(ctx: ProbeContext) { Some(arg) => arg, None => return, }; - if arg % 2 == 0 { + if arg.is_multiple_of(2) { entry.write(arg); entry.submit(0); } else {