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

allow &[u8] as range bound in state store interface #1334

Closed
Tracked by #1132
lmatz opened this issue Mar 28, 2022 · 3 comments
Closed
Tracked by #1132

allow &[u8] as range bound in state store interface #1334

lmatz opened this issue Mar 28, 2022 · 3 comments

Comments

@lmatz
Copy link
Contributor

lmatz commented Mar 28, 2022

LGTM! Would you please create a new issue to track "allow &[u8] as range bound in state store interface"?

Originally posted by @skyzh in #1266 (review)

The current implementation requires B: AsRef<[u8]> to be a value but not a reference to bypass the lifetime error.

Related: #1132

@BowenXiao1999
Copy link
Contributor

So we are going to completely remove B: AsRef<[u8]> + Send from interface and use &[u8] in each place?

@lmatz
Copy link
Contributor Author

lmatz commented Mar 28, 2022

So we are going to completely remove B: AsRef<[u8]> + Send from interface and use &[u8] in each place?

B: AsRef<[u8]> + Send would stay the same.

#1266 essentially disallows (Bound<&[u8]>, Bound<&[u8]>) to be used as R: RangeBounds<B> by requiring B: 'static.

This is because I cannot solve the lifetime error when allowing B to be &[u8]. This could be an issue on me or some bug in the compiler, which I don't know at this point.

Luckily, disallowing (Bound<&[u8]>, Bound<&[u8]>) does not affect us a lot for now.

This issue is used to track that in the future, we still want to accept (Bound<&[u8]>, Bound<&[u8]>) as R.

@skyzh
Copy link
Contributor

skyzh commented Oct 24, 2022

will be resolved by #5980, we only allow Vec<u8> now.

@skyzh skyzh closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants