refactor: `Vec::with_capacity(0)` => `vec![]`

`vec![]` also results in a capacity of 0, see
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=184113a9afa945cf3cf3b8f854f4c5ce
pull/24376/head
Marco Neumann 2021-10-12 16:36:06 +02:00
parent 173f9aefcf
commit f62d2d2277
2 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ impl SpanContext {
trace_id: TraceId(NonZeroU128::new(trace_id).unwrap()),
parent_span_id: None,
span_id: SpanId(NonZeroU64::new(span_id).unwrap()),
links: Vec::with_capacity(0),
links: vec![],
collector: Some(collector),
}
}
@ -85,7 +85,7 @@ impl SpanContext {
trace_id: self.trace_id,
span_id: SpanId::gen(),
collector: self.collector.clone(),
links: Vec::with_capacity(0),
links: vec![],
parent_span_id: Some(self.span_id),
},
start: None,

View File

@ -155,7 +155,7 @@ fn decode_b3(
}
// Links cannot be specified via the HTTP header
let links = Vec::with_capacity(0);
let links = vec![];
Ok(Some(SpanContext {
trace_id: required_header(headers, B3_TRACE_ID_HEADER, parse_trace)?,
@ -216,7 +216,7 @@ fn decode_jaeger(
}
// Links cannot be specified via the HTTP header
let links = Vec::with_capacity(0);
let links = vec![];
Ok(Some(SpanContext {
trace_id: decoded.trace_id,