Commit 83be28b
committed
Eliminate clippy redundant else error from src/webserver/http.rs
cargo clippy
Checking sqlpage v0.38.0
error: redundant else block
--> src\webserver\http.rs:493:6
|
493 | } else {
| ______^
494 | | if let Some(domain) = &config.https_domain {
495 | | let mut listen_on_https = listen_on;
496 | | listen_on_https.set_port(443);
... |
511 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
note: the lint level is defined here
--> src\lib.rs:1:9
|
1 | #![deny(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::redundant_else)]` implied by `#[deny(clippy::pedantic)]`
help: remove the `else` block and move the contents out
|
493 ~ }
494 + if let Some(domain) = &config.https_domain {
495 + let mut listen_on_https = listen_on;
496 + listen_on_https.set_port(443);
497 + log::debug!("Will start HTTPS server on {listen_on_https}");
498 + let config = make_auto_rustls_config(domain, config);
499 + server = server
500 + .bind_rustls_0_23(listen_on_https, config)
501 + .map_err(|e| bind_error(e, listen_on_https))?;
502 + } else if listen_on.port() == 443 {
503 + bail!("Please specify a value for https_domain in the configuration file. This is required when using HTTPS (port 443)");
504 + }
505 + if listen_on.port() != 443 {
506 + log::debug!("Will start HTTP server on {listen_on}");
507 + server = server
508 + .bind(listen_on)
509 + .map_err(|e| bind_error(e, listen_on))?;
510 + }
|
error: could not compile `sqlpage` (lib) due to 1 previous error1 parent 3654d42 commit 83be28b
1 file changed
Lines changed: 17 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
| |||
0 commit comments