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

Add Yokeable::upgrade_output function #3507

Open
sffc opened this issue Jun 8, 2023 · 1 comment
Open

Add Yokeable::upgrade_output function #3507

sffc opened this issue Jun 8, 2023 · 1 comment
Labels
C-zerovec Component: Yoke, ZeroVec, DataBake S-small Size: One afternoon (small bug fix or enhancement) T-techdebt Type: ICU4X code health and tech debt
Milestone

Comments

@sffc
Copy link
Member

sffc commented Jun 8, 2023

I would ideally like to avoid having any unsafety here.

I think all we need here is fn upgrade_output<Y: Yokeable<'static>>(output: Y::Output) -> Y, which internally calls Yokeable::make(). Does that make sense? Yokeable::make() is only scarily unsafe when the lifetimes involved aren't 'static.

Originally posted by @Manishearth in #3467 (comment)

@sffc sffc added T-techdebt Type: ICU4X code health and tech debt S-small Size: One afternoon (small bug fix or enhancement) C-zerovec Component: Yoke, ZeroVec, DataBake labels Jun 8, 2023
@sffc sffc added this to the Utilities 1.0 milestone Jun 8, 2023
@Manishearth
Copy link
Member

Manishearth commented Jun 8, 2023

This can't live on Yokeable but can be a free function in the crate somewhere.

(I guess it can if you give it a where bound but really I don't think it should anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-zerovec Component: Yoke, ZeroVec, DataBake S-small Size: One afternoon (small bug fix or enhancement) T-techdebt Type: ICU4X code health and tech debt
Projects
None yet
Development

No branches or pull requests

2 participants