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

Do not support Deref trait on exported newtypes #377

Open
agrover opened this issue Sep 17, 2018 · 1 comment
Open

Do not support Deref trait on exported newtypes #377

agrover opened this issue Sep 17, 2018 · 1 comment
Milestone

Comments

@agrover
Copy link
Contributor

agrover commented Sep 17, 2018

Being able to deref a Sectors, Datablocks, or MetaBlocks is a hatch for getting around additional (mostly arithmetic) traits being unimplemented for these newtypes. It may be better to add as_u64() or similar to these, to allow explicit conversion, instead of allowing these to be "unwrapped" with a *

@agrover agrover added this to the Future milestone Sep 17, 2018
@mulkieran
Copy link
Member

We can easily add more arithmetic traits. There is no fundamental reason why Bytes has fewer arithmetic traits than Sectors. Ideally, it should be at the point where the only reason for a deref is to pass it as a raw string to an ioct, or something like that.

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