Skip to content

Commit 5e9a5bc

Browse files
authored
chore: Use lint config in manifest (#2114)
1 parent 9691256 commit 5e9a5bc

File tree

17 files changed

+36
-44
lines changed

17 files changed

+36
-44
lines changed

Diff for: Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ members = [
3030
"tests/skip_debug",
3131
]
3232
resolver = "2"
33+
34+
[workspace.lints.rust]
35+
missing_debug_implementations = "warn"
36+
missing_docs = "warn"
37+
rust_2018_idioms = "warn"
38+
unreachable_pub = "warn"
39+
40+
[workspace.lints.rustdoc]
41+
broken_intra_doc_links = "deny"

Diff for: tonic-build/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ prost = ["prost-build", "dep:prost-types"]
2828
cleanup-markdown = ["prost-build?/cleanup-markdown"]
2929
transport = []
3030

31+
[lints]
32+
workspace = true
33+
3134
[package.metadata.docs.rs]
3235
all-features = true
3336

Diff for: tonic-build/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,9 @@
6161
//! fails with `No such file or directory` error.
6262
6363
#![recursion_limit = "256"]
64-
#![warn(
65-
missing_debug_implementations,
66-
missing_docs,
67-
rust_2018_idioms,
68-
unreachable_pub
69-
)]
7064
#![doc(
7165
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
7266
)]
73-
#![deny(rustdoc::broken_intra_doc_links)]
7467
#![doc(html_root_url = "https://docs.rs/tonic-build/0.13.0")]
7568
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
7669
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

Diff for: tonic-health/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ tokio = {version = "1.0", features = ["rt-multi-thread", "macros"]}
3030
tokio-stream = "0.1"
3131
prost-types = "0.13.0"
3232

33+
[lints]
34+
workspace = true
35+
3336
[package.metadata.cargo_check_external_types]
3437
allowed_external_types = [
3538
"tonic::*",

Diff for: tonic-health/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@
66
//!
77
//! [here]: https://github.com/hyperium/tonic/blob/master/examples/src/health/server.rs
88
9-
#![warn(
10-
missing_debug_implementations,
11-
missing_docs,
12-
rust_2018_idioms,
13-
unreachable_pub
14-
)]
159
#![doc(
1610
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
1711
)]
18-
#![deny(rustdoc::broken_intra_doc_links)]
1912
#![doc(html_root_url = "https://docs.rs/tonic-health/0.13.0")]
2013
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
2114
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

Diff for: tonic-reflection/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ tonic = { version = "0.13.0", path = "../tonic", default-features = false, featu
3636
[dev-dependencies]
3737
tonic = { version = "0.13.0", path = "../tonic", default-features = false, features = ["transport"] }
3838

39+
[lints]
40+
workspace = true
41+
3942
[package.metadata.cargo_check_external_types]
4043
allowed_external_types = [
4144
"tonic::*",

Diff for: tonic-reflection/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
//! A `tonic` based gRPC Server Reflection implementation.
22
3-
#![warn(
4-
missing_debug_implementations,
5-
missing_docs,
6-
rust_2018_idioms,
7-
unreachable_pub
8-
)]
93
#![doc(
104
html_logo_url = "https://github.com/hyperium/tonic/raw/master/.github/assets/tonic-docs.png"
115
)]
12-
#![deny(rustdoc::broken_intra_doc_links)]
136
#![doc(html_root_url = "https://docs.rs/tonic-reflection/0.13.0")]
147
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
158
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

Diff for: tonic-reflection/tests/server.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(missing_docs)]
2+
13
use prost::Message;
24
use std::net::SocketAddr;
35
use tokio::sync::oneshot;

Diff for: tonic-reflection/tests/versions.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(missing_docs)]
2+
13
use std::net::SocketAddr;
24

35
use tokio::sync::oneshot;

Diff for: tonic-types/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ prost = "0.13"
2222
prost-types = "0.13"
2323
tonic = { version = "0.13.0", path = "../tonic", default-features = false }
2424

25+
[lints]
26+
workspace = true
27+
2528
[package.metadata.cargo_check_external_types]
2629
allowed_external_types = [
2730
"tonic::*",

Diff for: tonic-types/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,9 @@
140140
//! [error_details.proto]: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
141141
//! [Richer Error example]: https://github.com/hyperium/tonic/tree/master/examples/src/richer-error
142142
143-
#![warn(
144-
missing_debug_implementations,
145-
missing_docs,
146-
rust_2018_idioms,
147-
unreachable_pub
148-
)]
149143
#![doc(
150144
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
151145
)]
152-
#![deny(rustdoc::broken_intra_doc_links)]
153146
#![doc(html_root_url = "https://docs.rs/tonic-types/0.13.0")]
154147
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
155148

Diff for: tonic-web/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ tracing = "0.1"
3030
tokio = { version = "1", features = ["macros", "rt"] }
3131
tower-http = { version = "0.6", features = ["cors"] }
3232

33+
[lints]
34+
workspace = true
35+
3336
[package.metadata.cargo_check_external_types]
3437
allowed_external_types = [
3538
"tonic::*",

Diff for: tonic-web/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ where
7878
}
7979
}
8080

81-
/// Response future for the [`GrpcWebService`].
81+
/// Response future for the [`GrpcWebService`](crate::GrpcWebService).
8282
#[pin_project]
8383
#[must_use = "futures do nothing unless polled"]
8484
pub struct ResponseFuture<F> {

Diff for: tonic-web/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
//! [`tonic_web`]: https://github.com/hyperium/tonic
6969
//! [grpc-web]: https://github.com/grpc/grpc-web
7070
//! [tower]: https://github.com/tower-rs/tower
71-
#![warn(
72-
missing_debug_implementations,
73-
missing_docs,
74-
rust_2018_idioms,
75-
unreachable_pub
76-
)]
7771
#![doc(html_root_url = "https://docs.rs/tonic-web/0.13.0")]
7872
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
7973

Diff for: tonic/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ static_assertions = "1.0"
107107
tokio = {version = "1.0", features = ["rt", "macros"]}
108108
tower = {version = "0.5", features = ["full"]}
109109

110+
[lints]
111+
workspace = true
112+
110113
[package.metadata.docs.rs]
111114
all-features = true
112115
rustdoc-args = ["--cfg", "docsrs"]

Diff for: tonic/benches/decode.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(missing_docs)]
2+
13
use bencher::{benchmark_group, benchmark_main, Bencher};
24
use bytes::{Buf, BufMut, Bytes, BytesMut};
35
use http_body::{Body, Frame, SizeHint};
@@ -45,11 +47,11 @@ struct MockBody {
4547
}
4648

4749
impl MockBody {
48-
pub fn new(data: Bytes, chunk_size: usize) -> Self {
50+
fn new(data: Bytes, chunk_size: usize) -> Self {
4951
MockBody { data, chunk_size }
5052
}
5153

52-
pub fn len(&self) -> usize {
54+
fn len(&self) -> usize {
5355
self.data.len()
5456
}
5557
}

Diff for: tonic/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@
8686
//! [`zstd`]: https://docs.rs/zstd
8787
8888
#![recursion_limit = "256"]
89-
#![warn(
90-
missing_debug_implementations,
91-
missing_docs,
92-
rust_2018_idioms,
93-
unreachable_pub
94-
)]
95-
#![deny(rustdoc::broken_intra_doc_links)]
9689
#![doc(
9790
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
9891
)]

0 commit comments

Comments
 (0)