Skip to content

Commit 6069c64

Browse files
committed
Replace rustfmt::skip with cfg_attr(rustfmt, rustfmt::skip)
As temporary work around for #551
1 parent eb71b6c commit 6069c64

17 files changed

+17
-17
lines changed

protobuf-codegen/src/code_writer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a> CodeWriter<'a> {
6262
self.write_line("#![allow(clippy::all)]");
6363
self.write_line("");
6464
self.write_line("#![allow(unused_attributes)]");
65-
self.write_line("#![rustfmt::skip]");
65+
self.write_line("#![cfg_attr(rustfmt, rustfmt::skip)]");
6666
self.write_line("");
6767
self.write_line("#![allow(box_pointers)]");
6868
self.write_line("#![allow(dead_code)]");

protobuf-codegen/src/well_known_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub(crate) fn gen_well_known_types_mod(
119119

120120
w.write_line("");
121121
w.write_line("#![allow(unused_attributes)]");
122-
w.write_line("#![rustfmt::skip]");
122+
w.write_line("#![cfg_attr(rustfmt, rustfmt::skip)]");
123123

124124
w.write_line("");
125125
for m in WELL_KNOWN_TYPES_PROTO_FILE_NAMES {

protobuf/src/descriptor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/doctest_pb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/plugin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/rustproto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/duration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/empty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/field_mask.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! [This document](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) describes these types.
66
77
#![allow(unused_attributes)]
8-
#![rustfmt::skip]
8+
#![cfg_attr(rustfmt, rustfmt::skip)]
99

1010
mod any;
1111
mod api;

protobuf/src/well_known_types/source_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/struct_pb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/timestamp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/type_pb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

protobuf/src/well_known_types/wrappers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::all)]
88

99
#![allow(unused_attributes)]
10-
#![rustfmt::skip]
10+
#![cfg_attr(rustfmt, rustfmt::skip)]
1111

1212
#![allow(box_pointers)]
1313
#![allow(dead_code)]

0 commit comments

Comments
 (0)