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

#23 Update dependencies and add static lifetime to SegmentedBuf... #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peter-lyons-kehl
Copy link
Contributor

For #23

Copy link
Collaborator

@c-nixon c-nixon left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

I'd rather not restrict T: 'static if we can avoid it. I have another suggestion for it

@@ -100,7 +100,7 @@ impl Buf for Buffer {

// TODO: expose size when const generics become available
#[derive(PartialEq)]
pub struct SegmentedBuf<T> {
pub struct SegmentedBuf<T: 'static> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I had a look at the countme code and it looks like we can avoid this by explicitly setting

_c: countme::Count<SegmentedBuf<T>>

rather than using Self

Copy link
Contributor Author

@peter-lyons-kehl peter-lyons-kehl May 27, 2022

Choose a reason for hiding this comment

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

Unfortunately, I get the same error with _c: countme::Count<SegmentedBuf<T>>:
image
(That was after reverting the rest of source code to current main except for Cargo.toml. Same error with either stable Rust 1.61.0 or v1.63.0-nightly).

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