Skip to content

Commit 1624efe

Browse files
committed
libbpf-cargo: Remove unused 'debug' argument
The 'debug' argument passed to gen_skel_contents() is unused; removed it and adjust callers accordingly. Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent 05ffa19 commit 1624efe

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

libbpf-cargo/src/gen/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ fn gen_skel_struct_ops_init(object: &Object) -> Result<String> {
854854
}
855855

856856
/// Generate contents of a single skeleton
857-
fn gen_skel_contents(_debug: bool, raw_obj_name: &str, obj_file_path: &Path) -> Result<String> {
857+
fn gen_skel_contents(raw_obj_name: &str, obj_file_path: &Path) -> Result<String> {
858858
let mut skel = String::new();
859859

860860
write!(
@@ -1185,15 +1185,14 @@ pub struct StructOps {{}}
11851185

11861186
/// Generate a single skeleton
11871187
fn gen_skel(
1188-
debug: bool,
11891188
name: &str,
11901189
obj: &Path,
11911190
out: OutputDest<'_>,
11921191
rustfmt_path: Option<&PathBuf>,
11931192
) -> Result<()> {
11941193
ensure!(!name.is_empty(), "Object file has no name");
11951194

1196-
let skel = gen_skel_contents(debug, name, obj)?;
1195+
let skel = gen_skel_contents(name, obj)?;
11971196
let skel = try_rustfmt(&skel, rustfmt_path)?;
11981197

11991198
match out {
@@ -1257,7 +1256,6 @@ pub(crate) fn gen_mods(objs: &[UnprocessedObj], rustfmt_path: Option<&PathBuf>)
12571256
}
12581257

12591258
pub(crate) fn gen_single(
1260-
debug: bool,
12611259
obj_file: &Path,
12621260
output: OutputDest<'_>,
12631261
rustfmt_path: Option<&PathBuf>,
@@ -1285,7 +1283,7 @@ pub(crate) fn gen_single(
12851283
),
12861284
};
12871285

1288-
let () = gen_skel(debug, name, obj_file, output, rustfmt_path).with_context(|| {
1286+
let () = gen_skel(name, obj_file, output, rustfmt_path).with_context(|| {
12891287
format!(
12901288
"Failed to generate skeleton for {}",
12911289
obj_file.to_string_lossy(),
@@ -1321,7 +1319,6 @@ fn gen_project(
13211319
skel_path.pop();
13221320

13231321
let () = gen_skel(
1324-
debug,
13251322
&obj.name,
13261323
obj_file_path.as_path(),
13271324
OutputDest::Directory(skel_path.as_path()),
@@ -1361,7 +1358,7 @@ pub fn gen(
13611358
}
13621359

13631360
if let Some(obj_file) = object {
1364-
gen_single(debug, obj_file, OutputDest::Stdout, rustfmt_path)
1361+
gen_single(obj_file, OutputDest::Stdout, rustfmt_path)
13651362
} else {
13661363
gen_project(debug, manifest_path, rustfmt_path)
13671364
}

libbpf-cargo/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ impl SkeletonBuilder {
269269
let objfile = self.obj.as_ref().ok_or_else(|| anyhow!("No object file"))?;
270270

271271
gen::gen_single(
272-
self.debug,
273272
objfile,
274273
gen::OutputDest::File(output.as_ref()),
275274
Some(&self.rustfmt),

0 commit comments

Comments
 (0)