Skip to content

Support any Display, not just &str #101

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

Closed
epage opened this issue Mar 13, 2024 · 2 comments
Closed

Support any Display, not just &str #101

epage opened this issue Mar 13, 2024 · 2 comments
Labels
C-enhancement Category: enhancement

Comments

@epage
Copy link
Contributor

epage commented Mar 13, 2024

This is split out of #13 (comment)

Input text doesn't have to be &str; it can be anything that can implement Display. This is especially useful when the origin source #12 (comment), so the intermediate allocation doesn't have to happen. Playing with take-two I think this dyn has negligible effect on runtime, the real killer to my time is dyn indirection to the span resolvers IIUC.

@epage epage added the C-enhancement Category: enhancement label Mar 13, 2024
@epage
Copy link
Contributor Author

epage commented Mar 13, 2024

I think this would actually hurt performance because we can't directly Display into a location but generally need to do calculations on it, so we'd need to do to_string(), even if its a &str, meaning we'll do more allocations.

@epage
Copy link
Contributor Author

epage commented Apr 16, 2025

Since we'd have to take a &dyn Display and to_string() it anyways, I feel this isn't offering us much and am going to go ahead and close this. If there is a reason we should re-visit this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant