Skip to content

Commit d067a20

Browse files
committed
server: avoid shadowing the app
1 parent ffbb917 commit d067a20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5454
// Start the background thread periodically persisting download counts to the database.
5555
downloads_counter_thread(app.clone());
5656

57-
let app = cargo_registry::build_handler(app);
57+
let handler = cargo_registry::build_handler(app);
5858

5959
// On every server restart, ensure the categories available in the database match
6060
// the information in *src/categories.toml*.
@@ -103,7 +103,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
103103
.build()
104104
.unwrap();
105105

106-
let handler = Arc::new(conduit_hyper::BlockingHandler::new(app));
106+
let handler = Arc::new(conduit_hyper::BlockingHandler::new(handler));
107107
let make_service =
108108
hyper::service::make_service_fn(move |socket: &hyper::server::conn::AddrStream| {
109109
let addr = socket.remote_addr();
@@ -134,7 +134,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
134134
println!("Booting with a civet based server");
135135
let mut cfg = civet::Config::new();
136136
cfg.port(port).threads(threads).keep_alive(true);
137-
Civet(CivetServer::start(cfg, app).unwrap())
137+
Civet(CivetServer::start(cfg, handler).unwrap())
138138
};
139139

140140
println!("listening on port {}", port);

0 commit comments

Comments
 (0)