Skip to content

Commit

Permalink
Cargo.toml: Set Rust edition for the project
Browse files Browse the repository at this point in the history
Use a Rust edition for the project: 2021, and fix imports to ensure the
crates builds correctly.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
  • Loading branch information
qmonnet committed Oct 29, 2024
1 parent b4079fe commit d5a79c1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repository = "https://github.com/qmonnet/rbpf"
readme = "README.md"
keywords = ["BPF", "eBPF", "interpreter", "JIT", "filtering"]
license = "Apache-2.0/MIT"
edition = "2021"

# Packaging directives
include = [
Expand Down
8 changes: 4 additions & 4 deletions src/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

//! This module translates eBPF assembly language to binary.

use asm_parser::{Instruction, Operand, parse};
use ebpf;
use ebpf::Insn;
use crate::asm_parser::{Instruction, Operand, parse};
use crate::asm_parser::Operand::{Integer, Memory, Register, Nil};
use crate::ebpf;
use crate::ebpf::Insn;
use self::InstructionType::{AluBinary, AluUnary, LoadAbs, LoadInd, LoadImm, LoadReg, StoreImm,
StoreReg, JumpUnconditional, JumpConditional, Call, Endian, NoOperand};
use asm_parser::Operand::{Integer, Memory, Register, Nil};
use crate::lib::*;

#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion src/disassembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use log::warn;
#[cfg(not(feature = "std"))]
use log::info;

use ebpf;
use crate::ebpf;
use crate::lib::*;

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/insn_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//! Module provides API to create eBPF programs by Rust programming language

use ebpf::*;
use crate::ebpf::*;
use crate::lib::*;

/// Represents single eBPF instruction
Expand Down
2 changes: 1 addition & 1 deletion src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
// (Translation to Rust, MetaBuff/multiple classes addition, hashmaps for helpers)

use ebpf;
use crate::ebpf;
use crate::lib::*;

#[allow(clippy::too_many_arguments)]
Expand Down
2 changes: 1 addition & 1 deletion src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::io::{Error, ErrorKind};
use std::ops::{Index, IndexMut};
use std::ptr;

use ebpf;
use crate::ebpf;

extern crate libc;

Expand Down
2 changes: 1 addition & 1 deletion src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// Contrary to the verifier of the Linux kernel, this one does not modify the bytecode at all.


use ebpf;
use crate::ebpf;
use crate::lib::*;

fn reject<S: AsRef<str>>(msg: S) -> Result<(), Error> {
Expand Down

0 comments on commit d5a79c1

Please sign in to comment.