diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 55f6c8c2..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,41 +0,0 @@ -environment: - global: - PROJECT_NAME: actix-net - matrix: - # Stable channel - - TARGET: i686-pc-windows-msvc - CHANNEL: stable - - TARGET: x86_64-pc-windows-gnu - CHANNEL: stable - - TARGET: x86_64-pc-windows-msvc - CHANNEL: stable - # Nightly channel - - TARGET: i686-pc-windows-msvc - CHANNEL: nightly - - TARGET: x86_64-pc-windows-gnu - CHANNEL: nightly - - TARGET: x86_64-pc-windows-msvc - CHANNEL: nightly - -# Install Rust and Cargo -# (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml) -install: - - ps: >- - If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') { - $Env:PATH += ';C:\msys64\mingw64\bin' - } ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') { - $Env:PATH += ';C:\MinGW\bin' - } - - curl -sSf -o rustup-init.exe https://win.rustup.rs - - rustup-init.exe --default-host %TARGET% --default-toolchain %CHANNEL% -y - - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - - rustc -Vv - - cargo -V - -# 'cargo test' takes care of building for us, so disable Appveyor's build stage. -build: false - -# Equivalent to Travis' `script` phase -test_script: - - cargo clean - - cargo test diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 00000000..9c90947b --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,17 @@ +on: pull_request + +name: Clippy Check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: clippy + override: true + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all --tests diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..a0a07c48 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,37 @@ +name: CI (macOS) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-apple-darwin + runs-on: macos-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-apple-darwin + profile: minimal + override: true + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 46fc2e5d..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: CI - -on: [push, pull_request] - -env: - VCPKGRS_DYNAMIC: 1 - -jobs: - build_and_test: - strategy: - fail-fast: false - matrix: - toolchain: - - x86_64-pc-windows-msvc - - x86_64-pc-windows-gnu - - i686-pc-windows-msvc - - x86_64-apple-darwin - version: - - stable - - nightly - include: - - toolchain: x86_64-pc-windows-msvc - os: windows-latest - arch: x64 - - toolchain: x86_64-pc-windows-gnu - os: windows-latest - - toolchain: i686-pc-windows-msvc - os: windows-latest - arch: x86 - - toolchain: x86_64-apple-darwin - os: macOS-latest - - name: ${{ matrix.version }} - ${{ matrix.toolchain }} - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@master - - - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.version }}-${{ matrix.toolchain }} - default: true - - - - name: Install OpenSSL - if: matrix.toolchain == 'x86_64-pc-windows-msvc' || matrix.toolchain == 'i686-pc-windows-msvc' - run: | - vcpkg integrate install - vcpkg install openssl:${{ matrix.arch }}-windows - - - name: check nightly - if: matrix.version == 'nightly' - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --benches --bins --examples --tests - - - name: check stable - if: matrix.version == 'stable' - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --bins --examples --tests - - - name: tests - if: matrix.toolchain != 'x86_64-pc-windows-gnu' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --all-features -- --nocapture - - - name: tests on x86_64-pc-windows-gnu - if: matrix.toolchain == 'x86_64-pc-windows-gnu' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all -- --nocapture diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml new file mode 100644 index 00000000..1d23ec86 --- /dev/null +++ b/.github/workflows/windows-mingw.yml @@ -0,0 +1,54 @@ +name: CI (Windows-gnu) + +on: [push, pull_request] + +env: + OPENSSL_DIR: d:\a\_temp\msys\msys64\usr + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-pc-windows-gnu + runs-on: windows-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-pc-windows-gnu + profile: minimal + override: true + + - name: Install MSYS2 + uses: numworks/setup-msys2@v1 + + - name: Install OpenSSL + run: | + msys2do pacman --noconfirm -S openssl-devel pkg-config + + - name: Copy and check libs + run: | + Copy-Item d:\a\_temp\msys\msys64\usr\lib\libssl.dll.a d:\a\_temp\msys\msys64\usr\lib\libssl.dll + Copy-Item d:\a\_temp\msys\msys64\usr\lib\libcrypto.dll.a d:\a\_temp\msys\msys64\usr\lib\libcrypto.dll + Get-ChildItem d:\a\_temp\msys\msys64\usr\lib + Get-ChildItem d:\a\_temp\msys\msys64\usr + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..92ce985d --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,63 @@ +name: CI (Windows) + +on: [push, pull_request] + +env: + VCPKGRS_DYNAMIC: 1 + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + target: + - x86_64-pc-windows-msvc + - i686-pc-windows-msvc + + name: ${{ matrix.version }} - ${{ matrix.target }} + runs-on: windows-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-${{ matrix.target }} + profile: minimal + override: true + + - name: Install OpenSSL (x64) + if: matrix.target == 'x86_64-pc-windows-msvc' + run: | + vcpkg integrate install + vcpkg install openssl:x64-windows + Get-ChildItem C:\vcpkg\installed\x64-windows\bin + Get-ChildItem C:\vcpkg\installed\x64-windows\lib + Copy-Item C:\vcpkg\installed\x64-windows\bin\libcrypto-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libcrypto.dll + Copy-Item C:\vcpkg\installed\x64-windows\bin\libssl-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libssl.dll + + - name: Install OpenSSL (x86) + if: matrix.target == 'i686-pc-windows-msvc' + run: | + vcpkg integrate install + vcpkg install openssl:x86-windows + Get-ChildItem C:\vcpkg\installed\x86-windows\bin + Get-ChildItem C:\vcpkg\installed\x86-windows\lib + Copy-Item C:\vcpkg\installed\x86-windows\bin\libcrypto-1_1.dll C:\vcpkg\installed\x86-windows\bin\libcrypto.dll + Copy-Item C:\vcpkg\installed\x86-windows\bin\libssl-1_1.dll C:\vcpkg\installed\x86-windows\bin\libssl.dll + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture diff --git a/actix-connect/src/ssl/rustls.rs b/actix-connect/src/ssl/rustls.rs index 01cb2fab..1964b3aa 100644 --- a/actix-connect/src/ssl/rustls.rs +++ b/actix-connect/src/ssl/rustls.rs @@ -38,7 +38,7 @@ where { pub fn service(connector: Arc) -> RustlsConnectorService { RustlsConnectorService { - connector: connector, + connector, _t: PhantomData, } } diff --git a/actix-ioframe/src/dispatcher.rs b/actix-ioframe/src/dispatcher.rs index 1565f797..3e000da6 100644 --- a/actix-ioframe/src/dispatcher.rs +++ b/actix-ioframe/src/dispatcher.rs @@ -213,7 +213,7 @@ where // drain service responses match Pin::new(&mut self.rx).poll_next(cx) { Poll::Ready(Some(Ok(msg))) => { - if let Err(_) = self.framed.write(msg) { + if self.framed.write(msg).is_err() { return Poll::Ready(Ok(())); } } diff --git a/actix-macros/src/lib.rs b/actix-macros/src/lib.rs index ec270f28..b6a57b9d 100644 --- a/actix-macros/src/lib.rs +++ b/actix-macros/src/lib.rs @@ -14,6 +14,7 @@ use quote::quote; /// println!("Hello world"); /// } /// ``` +#[allow(clippy::needless_doctest_main)] #[proc_macro_attribute] #[cfg(not(test))] // Work around for rust-lang/rust#62127 pub fn main(_: TokenStream, item: TokenStream) -> TokenStream { diff --git a/actix-rt/src/runtime.rs b/actix-rt/src/runtime.rs index a03361d6..bbafb6f0 100644 --- a/actix-rt/src/runtime.rs +++ b/actix-rt/src/runtime.rs @@ -86,7 +86,6 @@ impl Runtime { where F: Future + 'static, { - let res = self.local.block_on(&mut self.rt, f); - res + self.local.block_on(&mut self.rt, f) } } diff --git a/actix-server/src/builder.rs b/actix-server/src/builder.rs index 0f3722c9..ee1c3e2f 100644 --- a/actix-server/src/builder.rs +++ b/actix-server/src/builder.rs @@ -220,7 +220,7 @@ impl ServerBuilder { self.services.push(StreamNewService::create( name.as_ref().to_string(), token, - factory.clone(), + factory, addr, )); self.sockets diff --git a/actix-server/src/config.rs b/actix-server/src/config.rs index d1060ec5..464635b1 100644 --- a/actix-server/src/config.rs +++ b/actix-server/src/config.rs @@ -91,7 +91,7 @@ impl ConfiguredService { pub(super) fn stream(&mut self, token: Token, name: String, addr: net::SocketAddr) { self.names.insert(token, (name.clone(), addr)); - self.topics.insert(name.clone(), token); + self.topics.insert(name, token); self.services.push(token); } } diff --git a/actix-server/src/worker.rs b/actix-server/src/worker.rs index 4dbe3493..f51fd310 100644 --- a/actix-server/src/worker.rs +++ b/actix-server/src/worker.rs @@ -315,6 +315,8 @@ enum WorkerState { impl Future for Worker { type Output = (); + // FIXME: remove this attribute + #[allow(clippy::never_loop)] fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { // `StopWorker` message handler if let Poll::Ready(Some(StopCommand { graceful, result })) = @@ -368,11 +370,8 @@ impl Future for Worker { Ok(false) => { // push connection back to queue if let Some(conn) = conn { - match self.state { - WorkerState::Unavailable(ref mut conns) => { - conns.push(conn); - } - _ => (), + if let WorkerState::Unavailable(ref mut conns) = self.state { + conns.push(conn); } } Poll::Pending diff --git a/actix-server/tests/test_server.rs b/actix-server/tests/test_server.rs index a1cf1928..46587a80 100644 --- a/actix-server/tests/test_server.rs +++ b/actix-server/tests/test_server.rs @@ -41,7 +41,7 @@ fn test_bind() { thread::sleep(time::Duration::from_millis(500)); assert!(net::TcpStream::connect(addr).is_ok()); - let _ = sys.stop(); + sys.stop(); let _ = h.join(); } @@ -66,7 +66,7 @@ fn test_listen() { thread::sleep(time::Duration::from_millis(500)); assert!(net::TcpStream::connect(addr).is_ok()); - let _ = sys.stop(); + sys.stop(); let _ = h.join(); } @@ -130,7 +130,7 @@ fn test_start() { assert!(net::TcpStream::connect(addr).is_err()); thread::sleep(time::Duration::from_millis(100)); - let _ = sys.stop(); + sys.stop(); let _ = h.join(); } @@ -178,6 +178,6 @@ fn test_configure() { assert!(net::TcpStream::connect(addr2).is_ok()); assert!(net::TcpStream::connect(addr3).is_ok()); assert_eq!(num.load(Relaxed), 1); - let _ = sys.stop(); + sys.stop(); let _ = h.join(); } diff --git a/actix-service/src/and_then.rs b/actix-service/src/and_then.rs index b67de0a0..76ed35e9 100644 --- a/actix-service/src/and_then.rs +++ b/actix-service/src/and_then.rs @@ -313,7 +313,7 @@ mod tests { let mut srv = pipeline(Srv1(cnt.clone())).and_then(Srv2(cnt)); let res = srv.call("srv1").await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv1", "srv2"))); + assert_eq!(res.unwrap(), ("srv1", "srv2")); } #[actix_rt::test] diff --git a/actix-service/src/and_then_apply_fn.rs b/actix-service/src/and_then_apply_fn.rs index 4ff3b4d0..07f3b50d 100644 --- a/actix-service/src/and_then_apply_fn.rs +++ b/actix-service/src/and_then_apply_fn.rs @@ -290,6 +290,7 @@ mod tests { Poll::Ready(Ok(())) } + #[allow(clippy::unit_arg)] fn call(&mut self, req: Self::Request) -> Self::Future { ok(req) } @@ -297,7 +298,7 @@ mod tests { #[actix_rt::test] async fn test_service() { - let mut srv = pipeline(|r: &'static str| ok(r)) + let mut srv = pipeline(ok) .and_then_apply_fn(Srv, |req: &'static str, s| { s.call(()).map_ok(move |res| (req, res)) }); @@ -311,7 +312,7 @@ mod tests { #[actix_rt::test] async fn test_service_factory() { - let new_srv = pipeline_factory(|| ok::<_, ()>(fn_service(|r: &'static str| ok(r)))) + let new_srv = pipeline_factory(|| ok::<_, ()>(fn_service(ok))) .and_then_apply_fn( || ok(Srv), |req: &'static str, s| s.call(()).map_ok(move |res| (req, res)), diff --git a/actix-service/src/apply.rs b/actix-service/src/apply.rs index b8cc7426..df5df317 100644 --- a/actix-service/src/apply.rs +++ b/actix-service/src/apply.rs @@ -233,8 +233,8 @@ mod tests { let mut srv = pipeline(apply_fn(Srv, |req: &'static str, srv| { let fut = srv.call(()); async move { - let res = fut.await.unwrap(); - Ok((req, res)) + fut.await.unwrap(); + Ok((req, ())) } })); @@ -242,7 +242,7 @@ mod tests { let res = srv.call("srv").await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv", ()))); + assert_eq!(res.unwrap(), ("srv", ())); } #[actix_rt::test] @@ -252,8 +252,8 @@ mod tests { |req: &'static str, srv| { let fut = srv.call(()); async move { - let res = fut.await.unwrap(); - Ok((req, res)) + fut.await.unwrap(); + Ok((req, ())) } }, )); @@ -264,6 +264,6 @@ mod tests { let res = srv.call("srv").await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv", ()))); + assert_eq!(res.unwrap(), ("srv", ())); } } diff --git a/actix-service/src/then.rs b/actix-service/src/then.rs index b3a624ab..53ff1753 100644 --- a/actix-service/src/then.rs +++ b/actix-service/src/then.rs @@ -305,11 +305,11 @@ mod tests { let res = srv.call(Ok("srv1")).await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv1", "ok"))); + assert_eq!(res.unwrap(), ("srv1", "ok")); let res = srv.call(Err("srv")).await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv2", "err"))); + assert_eq!(res.unwrap(), ("srv2", "err")); } #[actix_rt::test] @@ -321,10 +321,10 @@ mod tests { let mut srv = factory.new_service(&()).await.unwrap(); let res = srv.call(Ok("srv1")).await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv1", "ok"))); + assert_eq!(res.unwrap(), ("srv1", "ok")); let res = srv.call(Err("srv")).await; assert!(res.is_ok()); - assert_eq!(res.unwrap(), (("srv2", "err"))); + assert_eq!(res.unwrap(), ("srv2", "err")); } } diff --git a/actix-testing/src/lib.rs b/actix-testing/src/lib.rs index 4fd68f9a..c1e192e1 100644 --- a/actix-testing/src/lib.rs +++ b/actix-testing/src/lib.rs @@ -1,6 +1,6 @@ //! Various helpers for Actix applications to use during testing. #![deny(rust_2018_idioms, warnings)] -#![allow(clippy::type_complexity)] +#![allow(clippy::type_complexity, clippy::needless_doctest_main)] use std::sync::mpsc; use std::{net, thread}; diff --git a/actix-utils/src/condition.rs b/actix-utils/src/condition.rs index 8830453d..097034da 100644 --- a/actix-utils/src/condition.rs +++ b/actix-utils/src/condition.rs @@ -107,7 +107,7 @@ mod tests { Poll::Pending ); cond.notify(); - assert_eq!(waiter.await, ()); + waiter.await; let mut waiter = cond.wait(); assert_eq!( @@ -121,7 +121,7 @@ mod tests { ); drop(cond); - assert_eq!(waiter.await, ()); - assert_eq!(waiter2.await, ()); + waiter.await; + waiter2.await; } } diff --git a/actix-utils/src/order.rs b/actix-utils/src/order.rs index fc099b6e..7dd4e2fc 100644 --- a/actix-utils/src/order.rs +++ b/actix-utils/src/order.rs @@ -242,7 +242,7 @@ mod tests { let rx2 = rx2; let rx3 = rx3; let tx_stop = tx_stop; - let _ = actix_rt::System::new("test").block_on(async { + actix_rt::System::new("test").block_on(async { let mut srv = InOrderService::new(Srv); let _ = lazy(|cx| srv.poll_ready(cx)).await; @@ -251,7 +251,7 @@ mod tests { let res3 = srv.call(rx3); actix_rt::spawn(async move { - let _ = poll_fn(|cx| { + poll_fn(|cx| { let _ = srv.poll_ready(cx); Poll::<()>::Pending }) diff --git a/router/src/lib.rs b/router/src/lib.rs index 7e41c4c3..75485b5a 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -69,7 +69,7 @@ impl<'a> IntoPattern for &'a str { } fn patterns(&self) -> Vec { - vec![self.to_string()] + vec![(*self).to_string()] } } @@ -79,7 +79,7 @@ impl> IntoPattern for Vec { } fn patterns(&self) -> Vec { - self.into_iter().map(|v| v.as_ref().to_string()).collect() + self.iter().map(|v| v.as_ref().to_string()).collect() } } diff --git a/router/src/resource.rs b/router/src/resource.rs index 00157775..b8a8c4d4 100644 --- a/router/src/resource.rs +++ b/router/src/resource.rs @@ -294,7 +294,7 @@ impl ResourceDef { return false; } for idx in 0..idx { - path.add(names[idx].clone(), segments[idx]); + path.add(names[idx], segments[idx]); } path.skip((pos + len) as u16); true @@ -326,7 +326,7 @@ impl ResourceDef { return false; } for idx in 0..idx { - path.add(names[idx].clone(), segments[idx]); + path.add(names[idx], segments[idx]); } path.skip((pos + len) as u16); true @@ -413,7 +413,7 @@ impl ResourceDef { let path = res.resource_path(); for idx in 0..idx { - path.add(names[idx].clone(), segments[idx]); + path.add(names[idx], segments[idx]); } path.skip((pos + len) as u16); true @@ -452,7 +452,7 @@ impl ResourceDef { let path = res.resource_path(); for idx in 0..idx { - path.add(names[idx].clone(), segments[idx]); + path.add(names[idx], segments[idx]); } path.skip((pos + len) as u16); true @@ -734,6 +734,7 @@ mod tests { assert_eq!(path.get("id").unwrap(), "012345"); } + #[allow(clippy::cognitive_complexity)] #[test] fn test_dynamic_set() { let re = ResourceDef::new(vec![ @@ -899,31 +900,31 @@ mod tests { fn test_resource_path() { let mut s = String::new(); let resource = ResourceDef::new("/user/{item1}/test"); - assert!(resource.resource_path(&mut s, &mut (&["user1"]).into_iter())); + assert!(resource.resource_path(&mut s, &mut (&["user1"]).iter())); assert_eq!(s, "/user/user1/test"); let mut s = String::new(); let resource = ResourceDef::new("/user/{item1}/{item2}/test"); - assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).into_iter())); + assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).iter())); assert_eq!(s, "/user/item/item2/test"); let mut s = String::new(); let resource = ResourceDef::new("/user/{item1}/{item2}"); - assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).into_iter())); + assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).iter())); assert_eq!(s, "/user/item/item2"); let mut s = String::new(); let resource = ResourceDef::new("/user/{item1}/{item2}/"); - assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).into_iter())); + assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).iter())); assert_eq!(s, "/user/item/item2/"); let mut s = String::new(); - assert!(!resource.resource_path(&mut s, &mut (&["item"]).into_iter())); + assert!(!resource.resource_path(&mut s, &mut (&["item"]).iter())); let mut s = String::new(); - assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).into_iter())); + assert!(resource.resource_path(&mut s, &mut (&["item", "item2"]).iter())); assert_eq!(s, "/user/item/item2/"); - assert!(!resource.resource_path(&mut s, &mut (&["item"]).into_iter())); + assert!(!resource.resource_path(&mut s, &mut (&["item"]).iter())); let mut s = String::new(); assert!(resource.resource_path(&mut s, &mut vec!["item", "item2"].into_iter())); diff --git a/router/src/router.rs b/router/src/router.rs index c65ac2db..bcbe61f9 100644 --- a/router/src/router.rs +++ b/router/src/router.rs @@ -104,6 +104,7 @@ mod tests { use crate::path::Path; use crate::router::{ResourceId, Router}; + #[allow(clippy::cognitive_complexity)] #[test] fn test_recognizer_1() { let mut router = Router::::build(); diff --git a/string/src/lib.rs b/string/src/lib.rs index 6e5d422f..2b600bde 100644 --- a/string/src/lib.rs +++ b/string/src/lib.rs @@ -204,7 +204,7 @@ mod test { #[test] fn test_from_static_str() { - const _S: ByteString = ByteString::from_static("hello"); + static _S: ByteString = ByteString::from_static("hello"); let _ = ByteString::from_static("str"); }