Skip to content

Commit 2f92752

Browse files
committed
Remove accidentally duplicated SpanKey
Signed-off-by: Bob Weinand <[email protected]>
1 parent c7da672 commit 2f92752

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

datadog-trace-utils/src/msgpack_decoder/v04/span.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::msgpack_decoder::decode::string::{
1010
read_nullable_str_map_to_strings, read_nullable_string,
1111
};
1212
use crate::msgpack_decoder::decode::{meta_struct::read_meta_struct, metrics::read_metrics};
13-
use crate::span::{v04::Span, SpanKey, TraceData};
13+
use crate::span::{v04::Span, v04::SpanKey, TraceData};
1414
use std::borrow::Borrow;
1515

1616
/// Decodes a slice of bytes into a `Span` object.

datadog-trace-utils/src/span/mod.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,53 +14,8 @@ use std::fmt;
1414
use std::fmt::Debug;
1515
use std::hash::Hash;
1616
use std::marker::PhantomData;
17-
use std::str::FromStr;
1817
use tinybytes::{Bytes, BytesString};
1918

20-
#[derive(Debug, PartialEq)]
21-
pub enum SpanKey {
22-
Service,
23-
Name,
24-
Resource,
25-
TraceId,
26-
SpanId,
27-
ParentId,
28-
Start,
29-
Duration,
30-
Error,
31-
Meta,
32-
Metrics,
33-
Type,
34-
MetaStruct,
35-
SpanLinks,
36-
SpanEvents,
37-
}
38-
39-
impl FromStr for SpanKey {
40-
type Err = SpanKeyParseError;
41-
42-
fn from_str(s: &str) -> Result<Self, Self::Err> {
43-
match s {
44-
"service" => Ok(SpanKey::Service),
45-
"name" => Ok(SpanKey::Name),
46-
"resource" => Ok(SpanKey::Resource),
47-
"trace_id" => Ok(SpanKey::TraceId),
48-
"span_id" => Ok(SpanKey::SpanId),
49-
"parent_id" => Ok(SpanKey::ParentId),
50-
"start" => Ok(SpanKey::Start),
51-
"duration" => Ok(SpanKey::Duration),
52-
"error" => Ok(SpanKey::Error),
53-
"meta" => Ok(SpanKey::Meta),
54-
"metrics" => Ok(SpanKey::Metrics),
55-
"type" => Ok(SpanKey::Type),
56-
"meta_struct" => Ok(SpanKey::MetaStruct),
57-
"span_links" => Ok(SpanKey::SpanLinks),
58-
"span_events" => Ok(SpanKey::SpanEvents),
59-
_ => Err(SpanKeyParseError::new(format!("Invalid span key: {s}"))),
60-
}
61-
}
62-
}
63-
6419
/// Trait representing the requirements for a type to be used as a Span "string" type.
6520
/// Note: Borrow<str> is not required by the derived traits, but allows to access HashMap elements
6621
/// from a static str and check if the string is empty.

0 commit comments

Comments
 (0)