Skip to content

Commit 8019d71

Browse files
committed
internal: skip rustfmt formatting of kernel-only module
The `quote` module only is available in the kernel and thus running `cargo fmt` or `rustfmt internal/src/lib.rs` results in: error: couldn't read `~/pin-init/internal/src/../../../macros/quote.rs`: No such file or directory (os error 2) --> ~/pin-init/internal/src/lib.rs:25:1 | 25 | mod quote; | ^^^^^^^^^^ Error writing files: failed to resolve mod `quote`: ~/pin-init/internal/src/../../../macros/quote.rs does not exist Thus mark it with `rustfmt::skip` when compiling without kernel support. Signed-off-by: Benno Lossin <benno.lossin@proton.me>
1 parent 00293ed commit 8019d71

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

internal/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use proc_macro::TokenStream;
2222
#[cfg(kernel)]
2323
#[path = "../../../macros/quote.rs"]
2424
#[macro_use]
25+
#[cfg_attr(not(kernel), rustfmt::skip)]
2526
mod quote;
2627
#[cfg(not(kernel))]
2728
#[macro_use]

0 commit comments

Comments
 (0)