trace: Fix subscriber benchmarks panicking (#1028)

This branch fixes the `tokio-trace` Subscriber benchmarks panicking due
to constructing spans with ID 0. They will now use an arbitrary constant
instead.

Signed-off-by: Eliza Weisman <[email protected]>
This commit is contained in:
Eliza Weisman
2019-04-02 13:42:31 -07:00
committed by GitHub
parent 9d8096b911
commit 4271a9cd8d
+2 -2
View File
@@ -18,7 +18,7 @@ struct EnabledSubscriber;
impl tokio_trace::Subscriber for EnabledSubscriber {
fn new_span(&self, span: &span::Attributes) -> Id {
let _ = span;
Id::from_u64(0)
Id::from_u64(0xDEADFACE)
}
fn event(&self, event: &Event) {
@@ -63,7 +63,7 @@ impl tokio_trace::Subscriber for VisitingSubscriber {
fn new_span(&self, span: &span::Attributes) -> Id {
let mut visitor = Visitor(self.0.lock().unwrap());
span.record(&mut visitor);
Id::from_u64(0)
Id::from_u64(0xDEADFACE)
}
fn record(&self, _span: &Id, values: &span::Record) {