Skip to content

Commit

Permalink
chore: fix new lints from rustc 1.72 update
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-cox authored and djc committed Aug 24, 2023
1 parent b22f7d1 commit 1688ec6
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion opentelemetry-api/src/trace/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl SpanBuilder {
I: IntoIterator<Item = KeyValue>,
{
SpanBuilder {
attributes: Some(OrderMap::from_iter(attributes.into_iter())),
attributes: Some(OrderMap::from_iter(attributes)),
..self
}
}
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-dynatrace/src/transform/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ mod tests {

#[test]
fn test_record_to_metric_line() -> Result<(), MetricsError> {
let attributes = vec![("KEY", "VALUE"), ("test.abc_123-", "value.123_foo-bar")];
let attributes = [("KEY", "VALUE"), ("test.abc_123-", "value.123_foo-bar")];
let attribute_set = AttributeSet::from_attributes(
attributes
.iter()
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/src/exporter/grpcio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl GrpcioExporterBuilder {
/// Set additional headers to send to the collector.
pub fn with_headers(mut self, headers: HashMap<String, String>) -> Self {
let mut inst_headers = self.grpcio_config.headers.unwrap_or_default();
inst_headers.extend(headers.into_iter());
inst_headers.extend(headers);
self.grpcio_config.headers = Some(inst_headers);
self
}
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/src/exporter/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl HttpExporterBuilder {
pub fn with_headers(mut self, headers: HashMap<String, String>) -> Self {
// headers will be wrapped, so we must do some logic to unwrap first.
let mut inst_headers = self.http_config.headers.unwrap_or_default();
inst_headers.extend(headers.into_iter());
inst_headers.extend(headers);
self.http_config.headers = Some(inst_headers);
self
}
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/src/exporter/tonic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl TonicExporterBuilder {
.metadata
.unwrap_or_default()
.into_headers();
existing_headers.extend(incoming_headers.into_iter());
existing_headers.extend(incoming_headers);

self.tonic_config.metadata = Some(MetadataMap::from_headers(existing_headers));
self
Expand Down
15 changes: 6 additions & 9 deletions opentelemetry-prometheus/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,12 @@ fn multiple_scopes() {
Box::new(TelemetryResourceDetector),
],
)
.merge(&mut Resource::new(
vec![
// always specify service.name because the default depends on the running OS
SERVICE_NAME.string("prometheus_test"),
// Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version
TELEMETRY_SDK_VERSION.string("latest"),
]
.into_iter(),
));
.merge(&mut Resource::new(vec![
// always specify service.name because the default depends on the running OS
SERVICE_NAME.string("prometheus_test"),
// Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version
TELEMETRY_SDK_VERSION.string("latest"),
]));

let provider = MeterProvider::builder()
.with_reader(exporter)
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-proto/src/transform/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub mod tonic {
body: log_record.body.map(Into::into),
attributes: log_record
.attributes
.map(|attrs| Attributes::from_iter(attrs.into_iter()))
.map(Attributes::from_iter)
.unwrap_or_default()
.0,
dropped_attributes_count: 0,
Expand Down Expand Up @@ -228,7 +228,7 @@ pub mod grpcio {
body: log_record.body.map(Into::into),
attributes: log_record
.attributes
.map(|attrs| Attributes::from_iter(attrs.into_iter()))
.map(Attributes::from_iter)
.unwrap_or_default()
.0,
dropped_attributes_count: 0,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-stackdriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl From<(EvictedHashMap, &Resource)> for Attributes {
let attribute_map = resource
.into_iter()
.map(|(k, v)| (k.clone(), v.clone()))
.chain(attributes.into_iter())
.chain(attributes)
.flat_map(|(k, v)| {
let key = k.as_str();
if key.len() > 128 {
Expand Down

0 comments on commit 1688ec6

Please sign in to comment.