Skip to content

Commit

Permalink
Tune up lints for 1.79 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jun 14, 2024
1 parent a99789a commit 65e29d1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
clippy::missing_assert_message,
Expand All @@ -119,7 +118,6 @@
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
clippy::readonly_write_lock,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::ref_patterns,
Expand Down Expand Up @@ -168,9 +166,11 @@
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
redundant_lifetimes,
semicolon_in_expressions_from_macros,
single_use_lifetimes,
unit_bindings,
unnameable_types,
unreachable_pub,
unsafe_op_in_unsafe_fn,
unstable_features,
Expand Down Expand Up @@ -236,7 +236,7 @@ pub fn try_install_freezable(
/// [`metrics::set_global_recorder()`].
// We do intentionally omit `#[must_use]` here, as we don't want to force
// library users using the returned `Recorder` directly.
#[allow(clippy::must_use_candidate)]
#[allow(clippy::must_use_candidate)] // intentional
pub fn install() -> Recorder {
Recorder::builder().build_and_install()
}
Expand All @@ -251,7 +251,7 @@ pub fn install() -> Recorder {
/// [`metrics::set_global_recorder()`].
// We do intentionally omit `#[must_use]` here, as we don't want to force
// library users using the returned `FreezableRecorder` directly.
#[allow(clippy::must_use_candidate)]
#[allow(clippy::must_use_candidate)] // intentional
pub fn install_freezable() -> FreezableRecorder {
Recorder::builder().build_freezable_and_install()
}
2 changes: 1 addition & 1 deletion src/recorder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ impl<S, L> Builder<S, L> {
/// # Ok::<_, prometheus::Error>(())
/// ```
// TODO: Anonymous lifetimes in `impl Trait` are unstable.
// Try remove on Rust 1.79 upgrade.
// Try remove on Rust 1.80 upgrade.
#[allow(single_use_lifetimes)]
pub fn with_registry<'r>(
mut self,
Expand Down
4 changes: 2 additions & 2 deletions src/storage/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Storage {

// PANIC: `RwLock` usage is fully panic-safe inside, so the `impl` is
// infallible, in fact.
#[allow(clippy::fallible_impl_from)]
#[allow(clippy::fallible_impl_from)] // intentional
impl From<&super::mutable::Storage> for Storage {
/// Creates a new immutable [`Storage`] by [draining] the referred
/// [`mutable::Storage`] and leaving it empty.
Expand All @@ -136,7 +136,7 @@ impl From<&super::mutable::Storage> for Storage {
/// [draining]: HashMap::drain
fn from(mutable: &super::mutable::Storage) -> Self {
// PANIC: `RwLock` usage is fully panic-safe here.
#![allow(clippy::unwrap_used)]
#![allow(clippy::unwrap_used)] // intentional

Self {
counters: mutable
Expand Down
12 changes: 6 additions & 6 deletions src/storage/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ impl Storage {
Self: super::Get<Collection<<M as metric::Bundled>::Bundle>>,
{
// PANIC: `RwLock` usage is fully panic-safe here.
#![allow(
#![allow( // intentional
clippy::missing_panics_doc,
clippy::unwrap_in_result,
clippy::unwrap_used
)]
// Intentionally, see the comment below on a `write_storage`.
#![allow(clippy::significant_drop_tightening)]
#![allow(clippy::significant_drop_tightening)] // intentional

use super::Get as _;

Expand Down Expand Up @@ -173,13 +173,13 @@ impl Storage {
{
// PANIC: `RwLock` usage is panic-safe here (considering the
// `prometheus::Registry::register()` does not).
#![allow(
#![allow( // intentional
clippy::missing_panics_doc,
clippy::unwrap_in_result,
clippy::unwrap_used
)]
// Intentionally, see the comment below on a `storage`.
#![allow(clippy::significant_drop_tightening)]
#![allow(clippy::significant_drop_tightening)] // intentional

use super::Get as _;
use metric::Bundle as _;
Expand Down Expand Up @@ -250,13 +250,13 @@ impl Storage {
{
// PANIC: `RwLock` usage is panic-safe here (considering the
// `prometheus::Registry::register()` does not).
#![allow(
#![allow( // intentional
clippy::missing_panics_doc,
clippy::unwrap_in_result,
clippy::unwrap_used
)]
// Intentionally, see the comment below on a `storage`.
#![allow(clippy::significant_drop_tightening)]
#![allow(clippy::significant_drop_tightening)] // intentional

use super::Get as _;

Expand Down

0 comments on commit 65e29d1

Please sign in to comment.