Pacify clippy

This commit is contained in:
Michael Vines
2021-02-18 23:42:09 -08:00
parent fd3b71a2c6
commit 5df36aec7d
40 changed files with 446 additions and 451 deletions

View File

@@ -4,14 +4,14 @@ use alloc::{Alloc, AllocErr};
use std::alloc::Layout;
#[derive(Debug)]
pub struct BPFAllocator {
pub struct BpfAllocator {
heap: Vec<u8>,
start: u64,
len: u64,
pos: u64,
}
impl BPFAllocator {
impl BpfAllocator {
pub fn new(heap: Vec<u8>, virtual_address: u64) -> Self {
let len = heap.len() as u64;
Self {
@@ -23,7 +23,7 @@ impl BPFAllocator {
}
}
impl Alloc for BPFAllocator {
impl Alloc for BpfAllocator {
fn alloc(&mut self, layout: Layout) -> Result<u64, AllocErr> {
let bytes_to_align = (self.pos as *const u8).align_offset(layout.align()) as u64;
if self