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

Why Reporter::report gets passed a reference instead of a Vec of owned objects? #217

Open
dgrr opened this issue May 17, 2024 · 1 comment

Comments

@dgrr
Copy link

dgrr commented May 17, 2024

Hello,

The Reporter::report gets called with drained objects, but they are converted to a ref slice, which doesn't allow to own the contents of each element.
That would avoid a lot of clones in the implementations, for example you could avoid the clones here.

Thanks.

@andylokandy
Copy link
Collaborator

Hi @dgrr! Sorry for the late response. The choice to pass a reference in Reporter::report is because cloning is cheaper than the following OpenTelemetry operations. Improving this is a great idea, and a PR would be welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants