trace: fix counters example, Span IDs must be greater than zero (#1037)

## Motivation
tokio-trace counter example was panicking due to returning 0 as the first Span Id

## Solution
start ID's with 1 instead
This commit is contained in:
João Oliveira 2019-04-05 21:51:20 +01:00 committed by Eliza Weisman
parent 197f88f3bc
commit 4f819b7cd1

View File

@ -113,7 +113,7 @@ impl Counters {
fn new() -> (Self, CounterSubscriber) {
let counters = Counters(Arc::new(RwLock::new(HashMap::new())));
let subscriber = CounterSubscriber {
ids: AtomicUsize::new(0),
ids: AtomicUsize::new(1),
counters: counters.clone(),
};
(counters, subscriber)