Skip to content

Commit

Permalink
Test and fix --no-default-features
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 20, 2023
1 parent 5c685c5 commit 43b73a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ jobs:
run: cargo clippy

- name: Test
run: cargo test
run: |
cargo test
cargo test --no-default-features
4 changes: 0 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ where
C: Read + Write,
{
Plain(C),
#[cfg(feature = "embedded-tls")]
PlainBuffered(BufferedWrite<'m, C>),
#[cfg(feature = "embedded-tls")]
Tls(embedded_tls::TlsConnection<'m, C, embedded_tls::Aes128GcmSha256>),
Expand Down Expand Up @@ -225,7 +224,6 @@ where
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
match self {
Self::Plain(conn) => conn.read(buf).await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::PlainBuffered(conn) => conn.read(buf).await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::Tls(conn) => conn.read(buf).await.map_err(|e| e.kind()),
Expand All @@ -242,7 +240,6 @@ where
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
match self {
Self::Plain(conn) => conn.write(buf).await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::PlainBuffered(conn) => conn.write(buf).await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::Tls(conn) => conn.write(buf).await.map_err(|e| e.kind()),
Expand All @@ -254,7 +251,6 @@ where
async fn flush(&mut self) -> Result<(), Self::Error> {
match self {
Self::Plain(conn) => conn.flush().await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::PlainBuffered(conn) => conn.flush().await.map_err(|e| e.kind()),
#[cfg(feature = "embedded-tls")]
Self::Tls(conn) => conn.flush().await.map_err(|e| e.kind()),
Expand Down
5 changes: 4 additions & 1 deletion src/reader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use embedded_io::{Error, ErrorKind, ErrorType};
use embedded_io::{ErrorKind, ErrorType};
use embedded_io_async::{BufRead, Read, Write};

#[cfg(feature = "embedded-tls")]
use embedded_io::Error;

use crate::client::HttpConnection;

struct ReadBuffer<'buf> {
Expand Down

0 comments on commit 43b73a7

Please sign in to comment.