From 4f819b7cd17782f3090bc50265b5af7314eb20ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 5 Apr 2019 21:51:20 +0100 Subject: [PATCH] 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 --- tokio-trace/examples/counters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-trace/examples/counters.rs b/tokio-trace/examples/counters.rs index 45717184d..4c5b35839 100644 --- a/tokio-trace/examples/counters.rs +++ b/tokio-trace/examples/counters.rs @@ -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)