Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shared slices instead of references to owned vectors as return types #1729

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/logs/log_emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl LoggerProvider {
}

/// Log processors associated with this provider.
pub fn log_processors(&self) -> &Vec<Box<dyn LogProcessor>> {
pub fn log_processors(&self) -> &[Box<dyn LogProcessor>] {
&self.inner.processors
}

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/trace/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl TracerProvider {
}

/// Span processors associated with this provider
pub fn span_processors(&self) -> &Vec<Box<dyn SpanProcessor>> {
pub fn span_processors(&self) -> &[Box<dyn SpanProcessor>] {
&self.inner.processors
}

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/trace/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Span {
data.end_time = opentelemetry::time::now();
}

match provider.span_processors().as_slice() {
match provider.span_processors() {
[] => {}
[processor] => {
processor.on_end(build_export_data(
Expand Down
Loading