File: fix-feature-tests.patch

package info (click to toggle)
rust-hyperlocal 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: makefile: 2
file content (70 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From: NoisyCoil <noisycoil@tutanota.com>
Date: Mon, 30 Sep 2024 23:10:48 +0200
Subject: [PATCH] Fix feature tests

---
 examples/client.rs     | 6 ++++++
 examples/server.rs     | 7 +++++++
 tests/server_client.rs | 3 +++
 3 files changed, 16 insertions(+)

diff --git a/examples/client.rs b/examples/client.rs
index b429464..c8a2501 100644
--- a/examples/client.rs
+++ b/examples/client.rs
@@ -1,1 +1,2 @@
+#![allow(unused_imports)]
 use http_body_util::{BodyExt, Full};
@@ -10,2 +10,3 @@
 use hyper_util::client::legacy::Client;
+#[cfg(feature = "client")]
 use hyperlocal::{UnixClientExt, UnixConnector, Uri};
@@ -20,2 +20,3 @@
 #[tokio::main]
+#[cfg(feature = "client")]
 async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
@@ -30,3 +30,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
 
     Ok(())
 }
+
+#[cfg(not(feature = "client"))]
+fn main() {}
diff --git a/examples/server.rs b/examples/server.rs
index 4792ad8..f870d76 100644
--- a/examples/server.rs
+++ b/examples/server.rs
@@ -1,1 +1,3 @@
+#![allow(unused_imports)]
+#![allow(dead_code)]
 use std::{error::Error, fs, path::Path};
@@ -10,2 +10,3 @@
 
+#[cfg(feature = "server")]
 use hyperlocal::UnixListenerExt;
@@ -20,2 +20,3 @@
 #[tokio::main]
+#[cfg(feature = "server")]
 async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
@@ -25,3 +29,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
 
     Ok(())
 }
+
+#[cfg(not(feature = "server"))]
+fn main() {}
diff --git a/tests/server_client.rs b/tests/server_client.rs
index 7930a3d..dd186c2 100644
--- a/tests/server_client.rs
+++ b/tests/server_client.rs
@@ -1,1 +1,2 @@
+#![allow(unused_imports)]
 use http_body_util::{BodyExt, Full};
@@ -5,2 +6,3 @@
 use hyper_util::{client::legacy::Client, rt::TokioIo};
+#[cfg(all(feature = "client", feature = "server"))]
 use hyperlocal::{UnixClientExt, UnixConnector, Uri};
@@ -20,2 +20,3 @@
 #[tokio::test]
+#[cfg(all(feature = "client", feature = "server"))]
 async fn test_server_client() -> Result<(), Box<dyn Error + Send + Sync>> {