-
Notifications
You must be signed in to change notification settings - Fork 725
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request
Describe the Feature Request
Add the ToSpanTrait to Spans to enhance generics
fn do_something_on_many<TS, T, +ToSpanTrait<TS, T>>(collection: TS){
collection.to_span().into_iter().map(|c| c.do_something())
}Where do_something_on_many can take Span<T>, Array<T> or [T; N] and in some cases of [T; N] It can solve the Non zero compiler issues
Describe Preferred Solution
impl SpanToSpan<T> of ToSpanTrait<Span<T>, T> {
#[inline]
fn span(self: @Span<T>) -> Span<T> {
*self
}
}Describe Alternatives
Related Code
Additional Context
If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)
- Yes
- No
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request