From f5153ac5a904833f9a3459309810874472c8bb0b Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Thu, 16 Jul 2026 18:45:56 +0200 Subject: [PATCH] chore: stop cargo fmt from rewriting the generated bindings The #[path] imports make rustfmt treat the vendor's generated bindings as crate source, so `cargo fmt` rewrapped ~1400 lines of api.rs/ffi.rs inside the submodule. The next regen reverts that, so it is pure churn -- and it shows up as a spurious dirty vendor. rustfmt.toml `ignore` would be the natural fix, but it is nightly-only and is silently dropped on stable ("unstable features are only available in nightly channel"), so the skip attribute goes on the imports instead. Co-Authored-By: Claude Opus 4.8 --- waku-bindings/src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/waku-bindings/src/lib.rs b/waku-bindings/src/lib.rs index 9eff68c..1652059 100644 --- a/waku-bindings/src/lib.rs +++ b/waku-bindings/src/lib.rs @@ -74,13 +74,21 @@ pub mod node; // regenerating it flows through directly. `api` resolves its siblings through // `super::`, so the three stay crate-root sibling modules. build.rs compiles // and links the underlying Nim library. +// +// `rustfmt::skip` because `#[path]` makes rustfmt treat these as crate source +// and rewrite them in the submodule; the next regen would revert it anyway, so +// `cargo fmt` would just churn the vendor. (rustfmt.toml `ignore` would be the +// natural fix, but it is nightly-only.) #[allow(clippy::all)] +#[rustfmt::skip] #[path = "../../vendor/library/rust_bindings/src/ffi.rs"] mod ffi; #[allow(clippy::all)] +#[rustfmt::skip] #[path = "../../vendor/library/rust_bindings/src/types.rs"] mod types; #[allow(clippy::all)] +#[rustfmt::skip] #[path = "../../vendor/library/rust_bindings/src/api.rs"] mod api; @@ -101,6 +109,4 @@ use rln; pub use general::contenttopic::{Encoding, WakuContentTopic}; pub use general::store::{StoreQueryRequest, StoreResponse, StoreWakuMessageResponse}; pub use general::{messagehash::MessageHash, Result, WakuMessage, WakuMessageVersion}; -pub use node::{ - Key, Multiaddr, PublicKey, PubsubTopic, RLNConfig, SecretKey, WakuNodeConfig, -}; +pub use node::{Key, Multiaddr, PublicKey, PubsubTopic, RLNConfig, SecretKey, WakuNodeConfig};