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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ log = "0.4"
time = "0.3"
derivative = "2"
smallvec = "1"
countme = "2"
countme = "3.0.1"

#serialization
serde = { version = "1", features = ["derive"] }
Expand All @@ -46,11 +46,11 @@ utf-8 = "0.7"
env_logger = "0.9"
tokio-test = "0.4"
tokio = { version = "1", features = ["rt", "macros", "io-util"] }
tokio-util = { version = "0.6", features = ["compat"] }
proptest = "0.10"
tokio-util = { version = "0.7.2", features = ["compat"] }
proptest = "1.0.0"
flate2 = "1.0"
serial_test = "0.5"
countme = { version = "2", features = ["enable"] }
serial_test = "0.6"
countme = { version = "3.0.1", features = ["enable"] }

[profile.release]
debug=true
6 changes: 3 additions & 3 deletions src/segmented_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).

_c: countme::Count<Self>,
pub(crate) bufs: SmallVec<[T; 4]>,
pos: usize,
Expand Down Expand Up @@ -318,7 +318,7 @@ impl futures::io::AsyncBufRead for SegmentedBuf<Reusable<Buffer>> {
}

#[pin_project]
pub struct SegmentedPoolBuf<Fut, T, Fi>
pub struct SegmentedPoolBuf<Fut, T: 'static, Fi>
where
T: ClearBuf,
{
Expand Down Expand Up @@ -713,7 +713,7 @@ impl futures::io::AsyncBufRead for SegmentedBufBytesReader<'_> {
}
}

pub struct SegmentedPoolBufIter<'a, F, T, Fi>
pub struct SegmentedPoolBufIter<'a, F, T: 'static, Fi>
where
T: std::marker::Send + ClearBuf,
{
Expand Down