diff --git a/src/common/headers.rs b/src/common/headers.rs index 3589543..c6861c3 100644 --- a/src/common/headers.rs +++ b/src/common/headers.rs @@ -117,7 +117,6 @@ impl Headers { /// # Examples /// /// ``` - /// extern crate micro_http; /// use micro_http::Headers; /// /// let mut request_header = Headers::default(); @@ -217,7 +216,6 @@ impl Headers { /// # Examples /// /// ``` - /// extern crate micro_http; /// use micro_http::Headers; /// /// let request_headers = Headers::try_from(b"Content-Length: 55\r\n\r\n"); @@ -275,7 +273,6 @@ impl MediaType { /// # Examples /// /// ``` - /// extern crate micro_http; /// use micro_http::MediaType; /// /// assert!(MediaType::try_from(b"application/json").is_ok()); @@ -299,7 +296,6 @@ impl MediaType { /// # Examples /// /// ``` - /// extern crate micro_http; /// use micro_http::MediaType; /// /// let media_type = MediaType::ApplicationJson; diff --git a/src/common/mod.rs b/src/common/mod.rs index 95583b8..2dec180 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -131,7 +131,6 @@ impl Display for ServerError { /// /// ## Examples /// ``` -/// extern crate micro_http; /// use micro_http::Body; /// let body = Body::new("This is a test body.".to_string()); /// assert_eq!(body.raw(), b"This is a test body."); @@ -216,7 +215,6 @@ impl Method { /// /// # Examples /// ``` -/// extern crate micro_http; /// use micro_http::Version; /// let version = Version::try_from(b"HTTP/1.1"); /// assert!(version.is_ok()); diff --git a/src/lib.rs b/src/lib.rs index 82b7fef..628169e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,6 @@ //! //! ## Example for parsing an HTTP Request from a slice //! ``` -//! extern crate micro_http; //! use micro_http::{Request, Version}; //! //! let http_request = Request::try_from(b"GET http://localhost/home HTTP/1.0\r\n\r\n").unwrap(); @@ -55,7 +54,6 @@ //! //! ## Example for creating an HTTP Response //! ``` -//! extern crate micro_http; //! use micro_http::{Body, MediaType, Response, StatusCode, Version}; //! //! let mut response = Response::new(Version::Http10, StatusCode::OK); @@ -82,7 +80,6 @@ //! ## Example for using the server //! //! ``` -//! extern crate micro_http; //! use micro_http::{HttpServer, Response, StatusCode}; //! //! let path_to_socket = "/tmp/example.sock"; @@ -109,9 +106,6 @@ //! } //! ``` -extern crate libc; -extern crate utils; - mod common; mod connection; mod request; diff --git a/src/request.rs b/src/request.rs index 1dba506..b470588 100644 --- a/src/request.rs +++ b/src/request.rs @@ -178,7 +178,6 @@ impl Request { /// # Examples /// /// ``` - /// extern crate micro_http; /// use micro_http::Request; /// /// let http_request = Request::try_from(b"GET http://localhost/home HTTP/1.0\r\n\r\n").unwrap(); diff --git a/src/server.rs b/src/server.rs index 6003c10..720f04e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -397,8 +397,6 @@ impl HttpServer { /// /// ## Non-blocking server /// ``` - /// extern crate utils; - /// /// use std::os::unix::io::AsRawFd; /// /// use micro_http::{HttpServer, Response, StatusCode}; diff --git a/src/vmm/src/vmm_config/mmds.rs b/src/vmm/src/vmm_config/mmds.rs index f6eddd0..349673d 100644 --- a/src/vmm/src/vmm_config/mmds.rs +++ b/src/vmm/src/vmm_config/mmds.rs @@ -1,6 +1,8 @@ // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +use serde::{export::Formatter, Deserialize}; +use std::fmt::{Display, Result}; use std::net::Ipv4Addr; /// Keeps the MMDS configuration.