Skip to content

Commit 701e57b

Browse files
committed
clippy
1 parent c1d92a9 commit 701e57b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/app_config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fn env_config() -> config::Environment {
9595
.with_list_parse_key("sqlite_extensions")
9696
}
9797

98+
#[must_use]
9899
pub fn default_listen_on() -> SocketAddr {
99100
SocketAddr::from(([0, 0, 0, 0], 8080))
100101
}

src/webserver/http.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,12 @@ pub async fn run_server(config: &AppConfig, state: AppState) -> anyhow::Result<(
496496
listen_on.set_port(443);
497497
log::info!("Will start HTTPS server on {listen_on}");
498498
server = server
499-
.bind_rustls_021(listen_on, make_auto_rustls_config(domain, config)?)
499+
.bind_rustls_021(listen_on, make_auto_rustls_config(domain, config))
500500
.with_context(|| "Unable to listen to the specified port")?;
501501
} else if listen_on.port() != 443 {
502502
server = server
503503
.bind(listen_on)
504-
.with_context(|| "Unable to listen to the specified port")?
504+
.with_context(|| "Unable to listen to the specified port")?;
505505
} else {
506506
bail!("Please specify a value for https_domain in the configuration file. This is required when using HTTPS.");
507507
}

src/webserver/https.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use tokio_stream::StreamExt;
33

44
use crate::app_config::AppConfig;
55

6-
pub fn make_auto_rustls_config(domain: &str, config: &AppConfig) -> anyhow::Result<ServerConfig> {
6+
pub fn make_auto_rustls_config(domain: &str, config: &AppConfig) -> ServerConfig {
77
log::info!("Starting HTTPS configuration for {domain}");
88
let mut state = AcmeConfig::new([domain])
99
.contact([if let Some(email) = &config.https_certificate_email {
1010
format!("mailto:{}", email.as_str())
1111
} else {
12-
format!("mailto:contact@{}", domain)
12+
format!("mailto:contact@{domain}")
1313
}])
1414
.cache_option(Some(DirCache::new(
1515
config.https_certificate_cache_dir.clone(),
@@ -27,5 +27,5 @@ pub fn make_auto_rustls_config(domain: &str, config: &AppConfig) -> anyhow::Resu
2727
}
2828
});
2929

30-
Ok(ServerConfig::clone(&rustls_config))
30+
ServerConfig::clone(&rustls_config)
3131
}

0 commit comments

Comments
 (0)