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

accept Into<IVec> for Tree operations that provide new values #627

Merged
merged 5 commits into from
Apr 9, 2019

Conversation

spacejam
Copy link
Owner

@spacejam spacejam commented Apr 9, 2019

No description provided.

@Kerollmops
Copy link
Contributor

Kerollmops commented Apr 9, 2019

Hum... It does seem that it will not pass the tests if you do not add a type annotation.

https://travis-ci.org/spacejam/sled/jobs/517825367#L1185

@Kerollmops
Copy link
Contributor

Kerollmops commented Apr 9, 2019

By the way, don't you think it could be "better" to bump to 0.21.5 once #626 is merged?

@spacejam
Copy link
Owner Author

spacejam commented Apr 9, 2019

versions are cheap!

@spacejam
Copy link
Owner Author

spacejam commented Apr 9, 2019

but, now that I realized there's some breakage possibility, I'll bump to 0.22

) -> Result<std::result::Result<(), Option<IVec>>>
where
K: AsRef<[u8]>,
IVec: From<V>,
OV: AsRef<[u8]>,
IVec: From<NV>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not NV: Into<IVec>? Just asking, no offense.

Copy link
Owner Author

Choose a reason for hiding this comment

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

because then below we can't use IVec::from(v), which is cleaner IMO than v.into() or turbofishing it

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I agree!

Kerollmops added a commit to Kerollmops/sled that referenced this pull request Apr 9, 2019
) -> Result<std::result::Result<(), Option<IVec>>>
where
K: AsRef<[u8]>,
OV: AsRef<[u8]>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you remenber that it was not possible the last time I tried? 😄
I do not think that the Rust language team changed that inference behavior, sadly...

#422 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, we will keep these lacks of inference. I prefer that, it is more generic!

Copy link
Owner Author

Choose a reason for hiding this comment

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

cas is already sort of a rare codepath and today I'm preferring genericism

Kerollmops added a commit to Kerollmops/sled that referenced this pull request Apr 9, 2019
@spacejam spacejam merged commit 39b8e4e into master Apr 9, 2019
@spacejam spacejam deleted the tyler_accept_ivec branch April 9, 2019 16:30
Kerollmops added a commit to Kerollmops/sled that referenced this pull request Apr 9, 2019
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.

2 participants