From a90357b1840e1092916e5c616e801bc8964b109e Mon Sep 17 00:00:00 2001 From: James Munns Date: Mon, 22 Aug 2022 19:50:46 +0200 Subject: [PATCH] Cargo fmt --- tracing-modality/src/common/ingest.rs | 5 +++-- tracing-modality/src/common/layer.rs | 2 +- tracing-modality/src/common/mod.rs | 8 -------- tracing-modality/src/common/options.rs | 6 +++--- tracing-modality/src/lib.rs | 2 -- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tracing-modality/src/common/ingest.rs b/tracing-modality/src/common/ingest.rs index 31b34af..cb01db1 100644 --- a/tracing-modality/src/common/ingest.rs +++ b/tracing-modality/src/common/ingest.rs @@ -341,7 +341,7 @@ impl ModalityIngest { // And return the timeline timeline_id - }, + } }; // TODO(AJM): DO LRU EVICTION HERE! @@ -365,7 +365,8 @@ impl ModalityIngest { } = message; // Ensure that the user reported timeline ID is active. - self.bind_user_timeline(timeline_name, user_timeline_id).await?; + self.bind_user_timeline(timeline_name, user_timeline_id) + .await?; match message { Message::NewSpan { diff --git a/tracing-modality/src/common/layer.rs b/tracing-modality/src/common/layer.rs index 63857ad..9b3ce35 100644 --- a/tracing-modality/src/common/layer.rs +++ b/tracing-modality/src/common/layer.rs @@ -1,7 +1,7 @@ use crate::ingest::TimelineId; use crate::ingest::WrappedMessage; -use crate::{ingest, TIMELINE_IDENTIFIER, UserTimelineInfo}; +use crate::{ingest, UserTimelineInfo, TIMELINE_IDENTIFIER}; use duplicate::duplicate_item; use once_cell::sync::Lazy; diff --git a/tracing-modality/src/common/mod.rs b/tracing-modality/src/common/mod.rs index 4c39a5c..9b619f8 100644 --- a/tracing-modality/src/common/mod.rs +++ b/tracing-modality/src/common/mod.rs @@ -6,7 +6,6 @@ pub(crate) mod options; use crate::Options; use ingest::ConnectError; use once_cell::sync::OnceCell; -use uuid::Uuid; use std::fmt::Debug; use thiserror::Error; @@ -41,13 +40,6 @@ impl UserTimelineInfo { // time. pub(crate) static TIMELINE_IDENTIFIER: OnceCell UserTimelineInfo> = OnceCell::new(); -// TODO(AJM): Probably combine this with TIMELINE_IDENTIFIER to make a single "OnceConfig" -// that we can use/reuse without having to grab multiple OnceCells -// -// That being said - this is randomly generated by us, so this *could* be a Lazy instead of -// a OnceCell, but that's probably more of a preference thing. -pub(crate) static RUN_ID: OnceCell = OnceCell::new(); - #[derive(Debug, Error)] pub enum InitError { /// No auth was provided, set with diff --git a/tracing-modality/src/common/options.rs b/tracing-modality/src/common/options.rs index 51e2976..82f42da 100644 --- a/tracing-modality/src/common/options.rs +++ b/tracing-modality/src/common/options.rs @@ -1,11 +1,11 @@ use crate::UserTimelineInfo; use modality_ingest_client::types::AttrVal; -use std::net::SocketAddr; use once_cell::sync::Lazy; use std::collections::hash_map::DefaultHasher; +use std::hash::Hash; use std::hash::Hasher; +use std::net::SocketAddr; use std::thread; -use std::hash::Hash; thread_local! { static THREAD_TIMELINE_INFO: Lazy = Lazy::new(|| { @@ -24,7 +24,7 @@ thread_local! { // alternatives would be: // // * To write a fake hasher function, that exfiltrates the underlying value - // * To use a "weaker" hash function than SipHash + // * To use a "weaker" hash function than SipHash, such as `rustc_hash::FxHasher` // // In practice, this only happens once per thread, so the actual impact is negligible, // and is acceptable for now, particularly as this is already the hasher used for diff --git a/tracing-modality/src/lib.rs b/tracing-modality/src/lib.rs index b8419c8..731e35d 100644 --- a/tracing-modality/src/lib.rs +++ b/tracing-modality/src/lib.rs @@ -3,8 +3,6 @@ // (almost) always be called from #![allow(clippy::needless_doctest_main)] #![warn(clippy::all)] - - // TODO(AJM): removeme #![allow(unused_variables, dead_code)]