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)]