Fix a warning about unused variables
This commit is contained in:
parent
e49b71b6d2
commit
f40f8337f3
|
@ -265,6 +265,7 @@ struct ServerInner {
|
||||||
routes: RoutingNode<Handler>,
|
routes: RoutingNode<Handler>,
|
||||||
timeout: Duration,
|
timeout: Duration,
|
||||||
complex_timeout: Option<Duration>,
|
complex_timeout: Option<Duration>,
|
||||||
|
#[cfg(feature = "scgi_srv")]
|
||||||
autorewrite: bool,
|
autorewrite: bool,
|
||||||
#[cfg(feature="ratelimiting")]
|
#[cfg(feature="ratelimiting")]
|
||||||
rate_limits: RoutingNode<RateLimiter<IpAddr>>,
|
rate_limits: RoutingNode<RateLimiter<IpAddr>>,
|
||||||
|
@ -674,6 +675,7 @@ pub struct Server {
|
||||||
timeout: Duration,
|
timeout: Duration,
|
||||||
complex_body_timeout_override: Option<Duration>,
|
complex_body_timeout_override: Option<Duration>,
|
||||||
routes: RoutingNode<Handler>,
|
routes: RoutingNode<Handler>,
|
||||||
|
#[cfg(feature = "scgi_srv")]
|
||||||
autorewrite: bool,
|
autorewrite: bool,
|
||||||
#[cfg(feature = "gemini_srv")]
|
#[cfg(feature = "gemini_srv")]
|
||||||
cert_path: PathBuf,
|
cert_path: PathBuf,
|
||||||
|
@ -696,6 +698,7 @@ impl Server {
|
||||||
timeout: Duration::from_secs(1),
|
timeout: Duration::from_secs(1),
|
||||||
complex_body_timeout_override: Some(Duration::from_secs(30)),
|
complex_body_timeout_override: Some(Duration::from_secs(30)),
|
||||||
routes: RoutingNode::default(),
|
routes: RoutingNode::default(),
|
||||||
|
#[cfg(feature = "scgi_srv")]
|
||||||
autorewrite: false,
|
autorewrite: false,
|
||||||
#[cfg(feature = "gemini_srv")]
|
#[cfg(feature = "gemini_srv")]
|
||||||
cert_path: PathBuf::from("cert/cert.pem"),
|
cert_path: PathBuf::from("cert/cert.pem"),
|
||||||
|
@ -881,6 +884,7 @@ impl Server {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "gemini_srv", allow(unused_mut), allow(unused_variables))]
|
||||||
/// Enable or disable autorewrite
|
/// Enable or disable autorewrite
|
||||||
///
|
///
|
||||||
/// Many times, an app will served alongside other apps all on one domain. For
|
/// Many times, an app will served alongside other apps all on one domain. For
|
||||||
|
@ -943,7 +947,9 @@ impl Server {
|
||||||
/// For more information about what responses are rewritten,
|
/// For more information about what responses are rewritten,
|
||||||
/// see [`Response::rewrite_all()`].
|
/// see [`Response::rewrite_all()`].
|
||||||
pub fn set_autorewrite(mut self, autorewrite: bool) -> Self {
|
pub fn set_autorewrite(mut self, autorewrite: bool) -> Self {
|
||||||
|
#[cfg(feature = "scgi_srv")] {
|
||||||
self.autorewrite = autorewrite;
|
self.autorewrite = autorewrite;
|
||||||
|
}
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,6 +971,7 @@ impl Server {
|
||||||
routes: self.routes,
|
routes: self.routes,
|
||||||
timeout: self.timeout,
|
timeout: self.timeout,
|
||||||
complex_timeout: self.complex_body_timeout_override,
|
complex_timeout: self.complex_body_timeout_override,
|
||||||
|
#[cfg(feature = "scgi_srv")]
|
||||||
autorewrite: self.autorewrite,
|
autorewrite: self.autorewrite,
|
||||||
#[cfg(feature = "gemini_srv")]
|
#[cfg(feature = "gemini_srv")]
|
||||||
tls_acceptor: TlsAcceptor::from(config),
|
tls_acceptor: TlsAcceptor::from(config),
|
||||||
|
|
Loading…
Reference in a new issue