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

Fix compilation errors #742

Merged
merged 4 commits into from
Mar 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@

#[cfg(feature = "tls")]
#[derive(Clone)]
pub(crate) struct TLSClientConfig(pub(crate) Arc<rustls::ClientConfig>);
pub(crate) struct TLSClientConfig(());

Check warning on line 685 in src/agent.rs

View workflow job for this annotation

GitHub Actions / build_versions (beta)

struct `TLSClientConfig` is never constructed

Check warning on line 685 in src/agent.rs

View workflow job for this annotation

GitHub Actions / build_versions (beta)

struct `TLSClientConfig` is never constructed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the point of this struct at all?

Copy link
Owner

Choose a reason for hiding this comment

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

It's not keeping something alive no?


#[cfg(feature = "tls")]
impl fmt::Debug for TLSClientConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/http_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl From<Response> for http::Response<Vec<u8>> {
let respone_builder = create_builder(&value);
let mut body_buf: Vec<u8> = vec![];
value.into_reader().read_to_end(&mut body_buf).unwrap();
respone_builder.body(body_buf).unwrap();
respone_builder.body(body_buf).unwrap()
}
}

Expand Down Expand Up @@ -329,7 +329,7 @@ mod tests {
#[test]
fn convert_to_http_response_bytes() {
use http::Response;
use std::io::{Cursor, Read};
use std::io::Cursor;

let mut response = super::Response::new(200, "OK", "tbr").unwrap();
// b'\xFF' as invalid UTF-8 character
Expand Down
1 change: 1 addition & 0 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl BufRead for DeadlineStream {
}

impl Read for DeadlineStream {
#[allow(clippy::unused_io_amount)]
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
// If the stream's BufReader has any buffered bytes, return those first.
// This avoids calling `fill_buf()` on DeadlineStream unnecessarily,
Expand Down
8 changes: 2 additions & 6 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,15 @@ impl Write for Recorder {
}
}

pub(crate) struct TestStream(
Box<dyn Read + Send + Sync>,
Box<dyn Write + Send + Sync>,
bool,
);
pub(crate) struct TestStream(Box<dyn Read + Send + Sync>, Box<dyn Write + Send + Sync>);

impl TestStream {
#[cfg(test)]
pub(crate) fn new(
response: impl Read + Send + Sync + 'static,
recorder: impl Write + Send + Sync + 'static,
) -> Self {
Self(Box::new(response), Box::new(recorder), false)
Self(Box::new(response), Box::new(recorder))
}
}

Expand Down
Loading