Skip to content

Commit

Permalink
fix: ci error on rust nightly version
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Jul 19, 2023
1 parent 9436ec8 commit 24d0b63
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions crates/core/src/conn/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ impl HttpBuilder {
};
match protocol {
Protocol::H1 => {
#[cfg(not(feature = "http1"))]
return Err(std::io::Error::new(std::io::ErrorKind::Other, "http1 feature not enabled").into());
#[cfg(feature = "http1")]
self.http1
.serve_connection(TokioIo::new(io), service)
.with_upgrades()
.await?
.await?;
}
Protocol::H2 => {
#[cfg(not(feature = "http2"))]
return Err(std::io::Error::new(std::io::ErrorKind::Other, "http2 feature not enabled").into());
#[cfg(feature = "http2")]
self.http2.serve_connection(TokioIo::new(io), service).await?;
}
Protocol::H2 => self.http2.serve_connection(TokioIo::new(io), service).await?,
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/conn/tcp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! TcpListener and it's implements.
use std::io::{Error as IoError, Result as IoResult};
use std::io::{Error as IoError, Result as IoResult, ErrorKind};
use std::sync::Arc;
use std::vec;

Expand Down Expand Up @@ -131,7 +131,7 @@ impl HttpConnection for TcpStream {
builder
.serve_connection(self, handler)
.await
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
.map_err(|e| IoError::new(ErrorKind::Other, e.to_string()))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/conn/unix.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! UnixListener module
use std::io::Result as IoResult;
use std::io::{Error as IoError, Result as IoResult, ErrorKind};
use std::path::Path;
use std::sync::Arc;

Expand Down Expand Up @@ -86,7 +86,7 @@ impl HttpConnection for UnixStream {
builder
.serve_connection(self, handler)
.await
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
.map_err(|e| IoError::new(ErrorKind::Other, e.to_string()))
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/oapi/src/openapi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod xml;

use crate::{router::NormNode, Endpoint};

static PATH_PARAMETER_NAME_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r#"\{([^}:]+)"#).unwrap());
static PATH_PARAMETER_NAME_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\{([^}:]+)").unwrap());

/// Root object of the OpenAPI document.
///
Expand Down

0 comments on commit 24d0b63

Please sign in to comment.