Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmunns committed Aug 22, 2022
1 parent be93d49 commit a90357b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
5 changes: 3 additions & 2 deletions tracing-modality/src/common/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl ModalityIngest {

// And return the timeline
timeline_id
},
}
};

// TODO(AJM): DO LRU EVICTION HERE!
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tracing-modality/src/common/layer.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 0 additions & 8 deletions tracing-modality/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -41,13 +40,6 @@ impl UserTimelineInfo {
// time.
pub(crate) static TIMELINE_IDENTIFIER: OnceCell<fn() -> 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<Uuid> = OnceCell::new();

#[derive(Debug, Error)]
pub enum InitError {
/// No auth was provided, set with
Expand Down
6 changes: 3 additions & 3 deletions tracing-modality/src/common/options.rs
Original file line number Diff line number Diff line change
@@ -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<UserTimelineInfo> = Lazy::new(|| {
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tracing-modality/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down

0 comments on commit a90357b

Please sign in to comment.