feat(server): Make the server code an optional feature (#2334)
				
					
				
			cc #2223 BREAKING CHANGE: The HTTP server code is now an optional feature. To enable the server, add `features = ["server"]` to the dependency in your `Cargo.toml`.
This commit is contained in:
		
							
								
								
									
										18
									
								
								src/cfg.rs
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								src/cfg.rs
									
									
									
									
									
								
							| @@ -11,16 +11,19 @@ macro_rules! cfg_feature { | ||||
|     } | ||||
| } | ||||
|  | ||||
| macro_rules! cfg_any_http { | ||||
| macro_rules! cfg_proto { | ||||
|     ($($item:item)*) => { | ||||
|         cfg_feature! { | ||||
|             #![any(feature = "http1", feature = "http2")] | ||||
|             #![all( | ||||
|                 any(feature = "http1", feature = "http2"), | ||||
|                 any(feature = "client", feature = "server"), | ||||
|             )] | ||||
|             $($item)* | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| cfg_any_http! { | ||||
| cfg_proto! { | ||||
|     macro_rules! cfg_http1 { | ||||
|         ($($item:item)*) => { | ||||
|             cfg_feature! { | ||||
| @@ -47,4 +50,13 @@ cfg_any_http! { | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     macro_rules! cfg_server { | ||||
|         ($($item:item)*) => { | ||||
|             cfg_feature! { | ||||
|                 #![feature = "server"] | ||||
|                 $($item)* | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user