async_traits is not needed anymore

This commit is contained in:
Tamo 2021-10-27 16:38:58 +02:00 committed by marin postma
parent 9abd2aa9d7
commit bba64b32ca
No known key found for this signature in database
GPG Key ID: 6088B7721C3E39F9

View File

@ -344,7 +344,6 @@ mod segment {
} }
} }
#[async_trait::async_trait]
impl super::Analytics for SegmentAnalytics { impl super::Analytics for SegmentAnalytics {
fn publish(&'static self, event_name: String, send: Value, request: Option<&HttpRequest>) { fn publish(&'static self, event_name: String, send: Value, request: Option<&HttpRequest>) {
let content_type = request let content_type = request
@ -564,7 +563,6 @@ impl MockAnalytics {
} }
} }
#[async_trait::async_trait]
impl Analytics for MockAnalytics { impl Analytics for MockAnalytics {
// These methods are noop and should be optimized out // These methods are noop and should be optimized out
fn publish(&'static self, _event_name: String, _send: Value, _request: Option<&HttpRequest>) {} fn publish(&'static self, _event_name: String, _send: Value, _request: Option<&HttpRequest>) {}
@ -594,7 +592,6 @@ impl Display for MockAnalytics {
} }
} }
#[async_trait::async_trait]
pub trait Analytics: Display + Sync + Send { pub trait Analytics: Display + Sync + Send {
/// The method used to publish most analytics that do not need to be batched every hours /// The method used to publish most analytics that do not need to be batched every hours
fn publish(&'static self, event_name: String, send: Value, request: Option<&HttpRequest>); fn publish(&'static self, event_name: String, send: Value, request: Option<&HttpRequest>);