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

Should Oid implement AsRef<[u8]> #108

Closed
Nemo157 opened this issue Feb 17, 2016 · 2 comments
Closed

Should Oid implement AsRef<[u8]> #108

Nemo157 opened this issue Feb 17, 2016 · 2 comments

Comments

@Nemo157
Copy link
Member

Nemo157 commented Feb 17, 2016

Not entirely certain this makes sense, but it would allow avoiding a call to as_bytes when passing an Oid into functions taking in &[u8] generically.

Looking through std there's precedence in that str.as_bytes() and AsRef::<[u8]>::as_ref(str) are equivalent.

@alexcrichton
Copy link
Member

I'd be fine with adding an impl!

@Nemo157
Copy link
Member Author

Nemo157 commented Feb 17, 2016

Cool, I'll probably get to it in the next day or so.

alexcrichton added a commit that referenced this issue Feb 18, 2016
Add `impl AsRef<[u8]> for Oid` (closes #108)
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