Skip to content

Commit

Permalink
use the Rust 2018 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasetter committed Nov 11, 2019
1 parent 5c7b6c1 commit 3a01c9c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description = "HTTP mocking for Rust."
keywords = ["mock", "mocks", "http", "webmock", "webmocks"]
categories = ["development-tools::testing", "web-programming"]
exclude = ["/.appveyor.yml", "/.travis.yml", "/benchmarks.txt", "/docs/", "/slides.pdf"]
edition = "2018"

[badges]
travis-ci = { repository = "lipanski/mockito", branch = "master" }
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ const SERVER_ADDRESS_INTERNAL: &str = "127.0.0.1:1234";
#[deprecated(note="Call server_url() instead")]
pub const SERVER_URL: &str = "http://127.0.0.1:1234";

pub use server::address as server_address;
pub use server::url as server_url;
pub use crate::server::address as server_address;
pub use crate::server::url as server_url;
use assert_json_diff::{Comparison, assert_json_no_panic, Actual, Expected};

///
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<'a> From<&'a TcpStream> for Request {
})
.and_then(|status| match status {
httparse::Status::Complete(head_length) => {
if let Some(a @ 0...1) = req.version {
if let Some(a @ 0..=1) = req.version {
request.version = (1, a);
}

Expand Down
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) struct Response {
#[derive(Clone)]
pub(crate) enum Body {
Bytes(Vec<u8>),
Fn(Arc<Fn(&mut dyn io::Write) -> io::Result<()> + Send + Sync + 'static>),
Fn(Arc<dyn Fn(&mut dyn io::Write) -> io::Result<()> + Send + Sync + 'static>),
}

impl fmt::Debug for Body {
Expand Down
4 changes: 2 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::fmt::Display;
use std::net::{TcpListener, TcpStream, SocketAddr};
use std::sync::Mutex;
use std::sync::mpsc;
use {SERVER_ADDRESS_INTERNAL, Request, Mock};
use response::{Chunked, Body};
use crate::{SERVER_ADDRESS_INTERNAL, Request, Mock};
use crate::response::{Chunked, Body};

impl Mock {
fn method_matches(&self, request: &Request) -> bool {
Expand Down

0 comments on commit 3a01c9c

Please sign in to comment.