diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1459755b7..70d41005c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,6 +2,10 @@ on:
pull_request:
branches:
- master
+ paths:
+ - '**.rs'
+ - 'Cargo.*'
+ - '*/Cargo.*'
name: Build and Test
diff --git a/Cargo.lock b/Cargo.lock
index d2bc02c3e..142b86ca7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -46,6 +46,15 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "ansi_term"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
+dependencies = [
+ "winapi",
+]
+
[[package]]
name = "anyhow"
version = "1.0.56"
@@ -408,6 +417,12 @@ dependencies = [
"uuid",
]
+[[package]]
+name = "diff"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
+
[[package]]
name = "difference"
version = "2.0.0"
@@ -503,6 +518,19 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
+[[package]]
+name = "flume"
+version = "0.10.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "843c03199d0c0ca54bc1ea90ac0d507274c28abcc4f691ae8b4eaa375087c76a"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+ "nanorand",
+ "pin-project",
+ "spin 0.9.2",
+]
+
[[package]]
name = "fnv"
version = "1.0.7"
@@ -653,8 +681,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
dependencies = [
"cfg-if 1.0.0",
+ "js-sys",
"libc",
"wasi 0.10.2+wasi-snapshot-preview1",
+ "wasm-bindgen",
]
[[package]]
@@ -1066,6 +1096,15 @@ dependencies = [
"twoway",
]
+[[package]]
+name = "nanorand"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
+dependencies = [
+ "getrandom",
+]
+
[[package]]
name = "native-tls"
version = "0.2.10"
@@ -1419,12 +1458,24 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
dependencies = [
- "ansi_term",
+ "ansi_term 0.11.0",
"ctor",
"difference",
"output_vt100",
]
+[[package]]
+name = "pretty_assertions"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57c038cb5319b9c704bf9c227c261d275bfec0ad438118a2787ce47944fb228b"
+dependencies = [
+ "ansi_term 0.12.1",
+ "ctor",
+ "diff",
+ "output_vt100",
+]
+
[[package]]
name = "pretty_env_logger"
version = "0.4.0"
@@ -1636,7 +1687,7 @@ dependencies = [
"cc",
"libc",
"once_cell",
- "spin",
+ "spin 0.5.2",
"untrusted",
"web-sys",
"winapi",
@@ -1652,12 +1703,13 @@ dependencies = [
"color-backtrace",
"crossbeam-channel",
"envy",
+ "flume",
"http",
"jsonwebtoken",
"log",
"matches",
"pollster",
- "pretty_assertions",
+ "pretty_assertions 1.2.0",
"pretty_env_logger",
"rustls",
"rustls-native-certs",
@@ -1682,7 +1734,7 @@ dependencies = [
"jemallocator",
"log",
"pprof 0.4.5",
- "pretty_assertions",
+ "pretty_assertions 0.6.1",
"pretty_env_logger",
"rustls-pemfile 0.3.0",
"segments",
@@ -1962,6 +2014,15 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
+[[package]]
+name = "spin"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
+dependencies = [
+ "lock_api",
+]
+
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
diff --git a/benchmarks/clients/mesh.rs b/benchmarks/clients/mesh.rs
index 8f6d04eec..96f38de50 100644
--- a/benchmarks/clients/mesh.rs
+++ b/benchmarks/clients/mesh.rs
@@ -3,7 +3,7 @@ use tokio::task;
use std::thread;
use std::path::PathBuf;
use bytes::Bytes;
-use rumqttlog::router::{Data};
+use rumqttlog::router::Data;
mod common;
@@ -74,5 +74,3 @@ async fn read(tx: Sender<(usize, RouterInMessage)>) {
println!("Id = {}, Total size = {}", id, total_size);
}
-
-
diff --git a/benchmarks/clients/rumqttasync.rs b/benchmarks/clients/rumqttasync.rs
index 3bfb49ee4..d16cf466b 100644
--- a/benchmarks/clients/rumqttasync.rs
+++ b/benchmarks/clients/rumqttasync.rs
@@ -1,4 +1,5 @@
-use rumqttc::*;
+use rumqttc::{AsyncClient, Event, Incoming, MqttOptions, QoS};
+
use std::error::Error;
use std::time::{Duration, Instant};
diff --git a/benchmarks/clients/rumqttasyncqos0.rs b/benchmarks/clients/rumqttasyncqos0.rs
index a2a668b0b..d00dd300a 100644
--- a/benchmarks/clients/rumqttasyncqos0.rs
+++ b/benchmarks/clients/rumqttasyncqos0.rs
@@ -1,4 +1,5 @@
-use rumqttc::*;
+use rumqttc::{AsyncClient, Event, Incoming, MqttOptions, QoS};
+
use std::error::Error;
use std::time::{Duration, Instant};
diff --git a/benchmarks/clients/rumqttsync.rs b/benchmarks/clients/rumqttsync.rs
index da85194dd..20c3e5c20 100644
--- a/benchmarks/clients/rumqttsync.rs
+++ b/benchmarks/clients/rumqttsync.rs
@@ -1,4 +1,4 @@
-use rumqttc::{self, Client, Event, Incoming, MqttOptions, QoS};
+use rumqttc::{Client, Event, Incoming, MqttOptions, QoS};
use std::error::Error;
use std::thread;
use std::time::{Duration, Instant};
diff --git a/benchmarks/simplerouter/src/protocol/v5.rs b/benchmarks/simplerouter/src/protocol/v5.rs
index c63fe816e..ab58f8ebd 100644
--- a/benchmarks/simplerouter/src/protocol/v5.rs
+++ b/benchmarks/simplerouter/src/protocol/v5.rs
@@ -135,16 +135,16 @@ pub(crate) mod connect {
len
}
- fn read(connect_flags: u8, mut bytes: &mut Bytes) -> Result