Skip to content

Commit df66985

Browse files
committed
box enums
1 parent 9dc8a45 commit df66985

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

opentelemetry-proto/src/transform/logs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub mod tonic {
5050
})
5151
.collect(),
5252
}),
53-
LogsAnyValue::Bytes(v) => Value::BytesValue(v),
53+
LogsAnyValue::Bytes(v) => Value::BytesValue(*v),
5454
}
5555
}
5656
}

opentelemetry-stdout/src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl From<opentelemetry::logs::AnyValue> for Value {
168168
})
169169
.collect(),
170170
),
171-
opentelemetry::logs::AnyValue::Bytes(b) => Value::BytesValue(b),
171+
opentelemetry::logs::AnyValue::Bytes(b) => Value::BytesValue(*b),
172172
}
173173
}
174174
}

opentelemetry/src/logs/record.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ pub enum AnyValue {
5959
/// A boolean value
6060
Boolean(bool),
6161
/// A byte array
62-
Bytes(Vec<u8>),
62+
Bytes(Box<Vec<u8>>),
6363
/// An array of `Any` values
64-
ListAny(Vec<AnyValue>),
64+
ListAny(Box<Vec<AnyValue>>),
6565
/// A map of string keys to `Any` values, arbitrarily nested.
66-
Map(HashMap<Key, AnyValue>),
66+
Map(Box<HashMap<Key, AnyValue>>),
6767
}
6868

6969
macro_rules! impl_trivial_from {
@@ -98,17 +98,17 @@ impl_trivial_from!(bool, AnyValue::Boolean);
9898
impl<T: Into<AnyValue>> FromIterator<T> for AnyValue {
9999
/// Creates an [`AnyValue::ListAny`] value from a sequence of `Into<AnyValue>` values.
100100
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
101-
AnyValue::ListAny(iter.into_iter().map(Into::into).collect())
101+
AnyValue::ListAny(Box::new(iter.into_iter().map(Into::into).collect()))
102102
}
103103
}
104104

105105
impl<K: Into<Key>, V: Into<AnyValue>> FromIterator<(K, V)> for AnyValue {
106106
/// Creates an [`AnyValue::Map`] value from a sequence of key-value pairs
107107
/// that can be converted into a `Key` and `AnyValue` respectively.
108108
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self {
109-
AnyValue::Map(HashMap::from_iter(
109+
AnyValue::Map(Box::new(HashMap::from_iter(
110110
iter.into_iter().map(|(k, v)| (k.into(), v.into())),
111-
))
111+
)))
112112
}
113113
}
114114

0 commit comments

Comments
 (0)