Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Rostecki <[email protected]>
  • Loading branch information
vadorovsky committed Sep 22, 2022
1 parent 28d1494 commit db2a8e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/bin/bpf-linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ struct CommandLine {
#[clap(long, value_name = "symbols", use_delimiter = true, multiple = true)]
export: Vec<String>,

#[clap(short = 'l', long = "lib", use_delimiter = true, multiple = true, hidden = true)]
#[clap(
short = 'l',
long = "lib",
use_delimiter = true,
multiple = true,
hidden = true
)]
_lib: Option<String>,
#[clap(long = "debug", hidden = true)]
_debug: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl Linker {
fn write_ir(&mut self, output: &CStr) -> Result<(), LinkerError> {
info!("writing IR to {:?}", output);

unsafe { llvm::write_ir(self.module, &output) }.map_err(LinkerError::WriteIRError)
unsafe { llvm::write_ir(self.module, output) }.map_err(LinkerError::WriteIRError)
}

fn emit(&mut self, output: &CStr, output_type: LLVMCodeGenFileType) -> Result<(), LinkerError> {
Expand Down
4 changes: 2 additions & 2 deletions src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub unsafe fn init<T: AsRef<str>>(args: &[T], overview: &str) {
LLVMInitializeBPFAsmPrinter();
LLVMInitializeBPFDisassembler();

parse_command_line_options(&args, overview);
parse_command_line_options(args, overview);
}

unsafe fn parse_command_line_options<T: AsRef<str>>(args: &[T], overview: &str) {
Expand Down Expand Up @@ -138,7 +138,7 @@ pub unsafe fn target_from_triple(triple: &CStr) -> Result<LLVMTargetRef, String>

pub unsafe fn target_from_module(module: LLVMModuleRef) -> Result<LLVMTargetRef, String> {
let triple = LLVMGetTarget(module);
target_from_triple(&CStr::from_ptr(triple))
target_from_triple(CStr::from_ptr(triple))
}

pub unsafe fn create_target_machine(
Expand Down

0 comments on commit db2a8e8

Please sign in to comment.