Skip to content
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "micro_http"
version = "0.1.0"
license = "Apache-2.0"
authors = ["Amazon Firecracker team <firecracker-devel@amazon.com>"]
edition = "2021"
edition = "2024"

[dependencies]
libc = "0.2.66"
Expand Down
10 changes: 5 additions & 5 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,12 @@ mod tests {
fn eq(&self, other: &Self) -> bool {
use self::ConnectionError::*;
match (self, other) {
(ParseError(ref e), ParseError(ref other_e)) => e.eq(other_e),
(ParseError(e), ParseError(other_e)) => e.eq(other_e),
(ConnectionClosed, ConnectionClosed) => true,
(StreamReadError(ref e), StreamReadError(ref other_e)) => {
(StreamReadError(e), StreamReadError(other_e)) => {
format!("{}", e).eq(&format!("{}", other_e))
}
(StreamWriteError(ref e), StreamWriteError(ref other_e)) => {
(StreamWriteError(e), StreamWriteError(other_e)) => {
format!("{}", e).eq(&format!("{}", other_e))
}
(InvalidWrite, InvalidWrite) => true,
Expand All @@ -361,8 +361,8 @@ mod tests {
fn eq(&self, other: &Self) -> bool {
use self::ServerError::*;
match (self, other) {
(ConnectionError(ref e), ConnectionError(ref other_e)) => e.eq(other_e),
(IOError(ref e), IOError(ref other_e)) => {
(ConnectionError(e), ConnectionError(other_e)) => e.eq(other_e),
(IOError(e), IOError(other_e)) => {
e.raw_os_error() == other_e.raw_os_error()
}
(Overflow, Overflow) => true,
Expand Down
3 changes: 2 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ impl HttpServer {
/// # Errors
/// Returns an `IOError` when `epoll::create` fails.
pub unsafe fn new_from_fd(socket_fd: RawFd) -> Result<Self> {
let socket = UnixListener::from_raw_fd(socket_fd);
// Safety: see the safety contract of this function.
let socket = unsafe { UnixListener::from_raw_fd(socket_fd) };
let epoll = epoll::Epoll::new().map_err(ServerError::IOError)?;
Ok(HttpServer {
socket,
Expand Down