Skip to content

Commit

Permalink
chore: fixes for clippy changes in Rust 1.74 (tokio-rs#2814)
Browse files Browse the repository at this point in the history
With the release of Rust 1.74, there are some new or modified clippy
lints that need adaption in the code.

The main change was the removal of the `private_in_public`.
https://rust-lang.github.io/rfcs/2145-type-privacy.html

Then two more changes were required, in one case to adhere a lint and
the other to allow it. When talking about what an "application" needs to
do when setting up `tracing-error`, it makes sense to include `fn
main()` in the doctest, even though the lint recommends against it.
  • Loading branch information
hds committed Nov 26, 2023
1 parent 8ba80ae commit bac2508
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/examples/map-traced-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn do_something() -> Result<(), TracedError<OuterError>> {

#[tracing::instrument]
fn do_the_real_stuff() -> Result<(), TracedError<InnerError>> {
Err(InnerError).map_err(TracedError::from)
Err(TracedError::from(InnerError))
}

#[derive(Debug)]
Expand Down
3 changes: 2 additions & 1 deletion tracing-appender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused_allocation,
unused_comparisons,
Expand Down
3 changes: 2 additions & 1 deletion tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
4 changes: 3 additions & 1 deletion tracing-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
html_favicon_url = "https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/favicon.ico",
issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"
)]
#![allow(clippy::needless_doctest_main)]
#![warn(
missing_debug_implementations,
missing_docs,
Expand All @@ -196,7 +197,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-flame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing-tower/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
3 changes: 2 additions & 1 deletion tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,8 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
private_interfaces,
private_bounds,
unconditional_recursion,
unused,
unused_allocation,
Expand Down

0 comments on commit bac2508

Please sign in to comment.