cargo clippy (#660)

This commit is contained in:
Adil Hafeez 2025-12-25 21:08:37 -08:00 committed by GitHub
parent c75e7606f9
commit ca95ffb63d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 1864 additions and 1187 deletions

View file

@ -1,4 +1,4 @@
use super::shapes::{Span, Attribute, AttributeValue};
use super::shapes::{Attribute, AttributeValue, Span};
use std::collections::HashMap;
use std::time::SystemTime;
@ -116,10 +116,11 @@ impl SpanBuilder {
let end_nanos = system_time_to_nanos(end_time);
// Generate trace_id if not provided
let trace_id = self.trace_id.unwrap_or_else(|| generate_random_trace_id());
let trace_id = self.trace_id.unwrap_or_else(generate_random_trace_id);
// Create attributes in OTEL format
let attributes: Vec<Attribute> = self.attributes
let attributes: Vec<Attribute> = self
.attributes
.into_iter()
.map(|(key, value)| Attribute {
key,
@ -132,7 +133,7 @@ impl SpanBuilder {
// Build span directly without going through Span::new()
Span {
trace_id,
span_id: self.span_id.unwrap_or_else(|| generate_random_span_id()),
span_id: self.span_id.unwrap_or_else(generate_random_span_id),
parent_span_id: self.parent_span_id,
name: self.name,
start_time_unix_nano: format!("{}", start_nanos),