all: bump MSRV to 1.87.0

Use newly stabilized `is_multiple_of`.
pull/1387/head
Tamir Duberstein 1 week ago
parent 468b9b73db
commit 866cbe4837
No known key found for this signature in database

@ -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

@ -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<Vec<bpf_insn>, ParseError> {
if data.len() % mem::size_of::<bpf_insn>() > 0 {
if !data.len().is_multiple_of(mem::size_of::<bpf_insn>()) {
return Err(ParseError::InvalidProgramCode);
}
let instructions = data

@ -202,7 +202,7 @@ fn relocate_maps<'a, I: Iterator<Item = &'a Relocation>>(
// 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,

@ -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 {

Loading…
Cancel
Save