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 AsRef and AsMut implementation. #60

Merged
merged 2 commits into from
Jan 6, 2018
Merged

Add AsRef and AsMut implementation. #60

merged 2 commits into from
Jan 6, 2018

Conversation

Object905
Copy link
Contributor

Hi! I wanted to use Mmap behind the std::io::Cursor and got the trait std::convert::AsRef<[u8]> is not implemented for memmap::Mmap.

src/lib.rs Outdated
@@ -396,6 +396,12 @@ impl Deref for Mmap {
}
}

impl AsRef<[u8]> for Mmap {
fn as_ref(&self) -> &[u8] {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could put an #[inline] attribute on these.

@KodrAus
Copy link

KodrAus commented Jan 1, 2018

The build failure seems unrelated and might need an update of winapi to fix?

@Object905
Copy link
Contributor Author

@KodrAus winapi 0.3 has some breaking changes, so this probably should be done in separate PR.

@danburkert
Copy link
Owner

Changes look good! I think it may just be a flake, so I'll re-run. Regardless I'm going to throw together a commit to move us to winapi 0.3 so should be fixed soon. Thanks!

@danburkert danburkert merged commit 800f001 into danburkert:master Jan 6, 2018
danburkert pushed a commit that referenced this pull request Jan 6, 2018
add AsRef and AsMut implementation
@danburkert
Copy link
Owner

This has been released as part of 0.6.2. Heads up: I accidentally didn't push the 0.6.1 release commit/tag to github when I released it back in November, so the git history got out of wack with crates.io. Since crates.io is immutable, I opted to correct the history in GitHub and force push to the master branch. Shouldn't cause any issues, but you may need to reset your master branch if you've pulled since this commit landed.

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

Successfully merging this pull request may close these issues.

None yet

3 participants