From 70c6c9547e7e4cf12fa96a73fe8a19a62f05d1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Mon, 12 Oct 2026 09:20:34 +0200 Subject: [PATCH] Improve CHANGELOG message for #1465 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve the CHANGELOG message for #1465 and the style of some code comments. Signed-off-by: Daniel Müller --- libbpf-cargo/CHANGELOG.md | 6 +++--- libbpf-cargo/src/gen/mod.rs | 5 ++--- libbpf-cargo/src/lib.rs | 4 ++-- libbpf-cargo/src/main.rs | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libbpf-cargo/CHANGELOG.md b/libbpf-cargo/CHANGELOG.md index 3330ffd9..c48c4cc8 100644 --- a/libbpf-cargo/CHANGELOG.md +++ b/libbpf-cargo/CHANGELOG.md @@ -1,8 +1,8 @@ Unreleased ---------- -- Added ability to skip running `rustfmt` on the skeleton Rust source entirely - in `libbpf-cargo` by setting `rustfmt-path` to an empty string for the CLI or - passing an empty path to `SkeletonBuilder::rustfmt()`. +- Added ability to skip running `rustfmt` on generated skeleton by + passing empty string to `--rustfmt-path` command line option or + `SkeletonBuilder::rustfmt()` 0.27.2 diff --git a/libbpf-cargo/src/gen/mod.rs b/libbpf-cargo/src/gen/mod.rs index bcf34261..ab756461 100644 --- a/libbpf-cargo/src/gen/mod.rs +++ b/libbpf-cargo/src/gen/mod.rs @@ -224,9 +224,8 @@ pub(crate) enum OutputDest<'a> { /// Try running `rustfmt` over `s` and return result. /// -/// If no `rustfmt` binary could be found, or an empty path is supplied, -/// the content is left untouched, as it's only meant as a cosmetic brush up, -/// without change of semantics. +/// If no `rustfmt` binary could be found or an empty path is supplied, +/// the content is left untouched. fn try_rustfmt<'code>(s: &'code str, rustfmt_path: Option<&Path>) -> Result> { let result = if let Some(r) = rustfmt_path { if r.as_os_str().is_empty() { diff --git a/libbpf-cargo/src/lib.rs b/libbpf-cargo/src/lib.rs index 30691453..2a435fae 100644 --- a/libbpf-cargo/src/lib.rs +++ b/libbpf-cargo/src/lib.rs @@ -182,8 +182,8 @@ impl SkeletonBuilder { /// Specify which `rustfmt` binary to use. /// - /// Default searches `$PATH` for `rustfmt`. - /// To skip formatting, an empty path can be supplied. + /// Default searches `$PATH` for `rustfmt`. To skip formatting, an + /// empty path can be supplied. pub fn rustfmt>(&mut self, rustfmt: P) -> &mut Self { self.rustfmt = rustfmt.as_ref().to_path_buf(); self diff --git a/libbpf-cargo/src/main.rs b/libbpf-cargo/src/main.rs index cbd9e26b..3a65f72d 100644 --- a/libbpf-cargo/src/main.rs +++ b/libbpf-cargo/src/main.rs @@ -79,6 +79,7 @@ enum Command { manifest_path: Option, #[arg(long, value_parser)] /// Path to rustfmt binary. + /// /// If set to an empty path, formatting will be skipped. rustfmt_path: Option, #[arg(long, value_parser)]