Skip to content

Commit 0a6c988

Browse files
committed
web: Convert web to a lib
The web module has been converted in a lib, but also maintaining the associated binary.
1 parent 0cd8d09 commit 0a6c988

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

rust-code-analysis-web/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ keywords = ["metrics"]
88
description = "Run a web service to compute and export code metrics"
99
license = "MPL-2.0"
1010

11-
[[bin]]
12-
name = "rust-code-analysis-web"
13-
1411
[dependencies]
1512
actix-rt = "^2.6"
1613
actix-web = "^4.2"

rust-code-analysis-web/src/main.rs renamed to rust-code-analysis-web/src/bin/rust-code-analysis-web.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
// After adding new fields for min and max in the json (server.rs line 630) this error arose:
2-
// error: recursion limit reached while expanding `json_internal!`
3-
// This solution was proposed as help by the compiler
4-
// for the full error details check here :https://github.com/mozilla/rust-code-analysis/pull/793#discussion_r817610530
5-
#![recursion_limit = "256"]
6-
mod web;
7-
81
use std::thread::available_parallelism;
92

103
use clap::Parser;
114

12-
use web::server;
5+
use rust_code_analysis_web::server::run;
136

147
#[derive(Parser, Debug)]
158
#[clap(
@@ -40,7 +33,7 @@ async fn main() {
4033
.get()
4134
});
4235

43-
if let Err(e) = server::run(&opts.host, opts.port, num_jobs).await {
36+
if let Err(e) = run(&opts.host, opts.port, num_jobs).await {
4437
eprintln!(
4538
"Cannot run the server at {}:{}: {}",
4639
opts.host, opts.port, e

rust-code-analysis-web/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// After adding new fields for min and max in the json (server.rs line 630) this error arose:
2+
// error: recursion limit reached while expanding `json_internal!`
3+
// This solution was proposed as help by the compiler
4+
// for the full error details check here :https://github.com/mozilla/rust-code-analysis/pull/793#discussion_r817610530
5+
#![recursion_limit = "256"]
6+
pub mod web;
7+
pub use web::*;

0 commit comments

Comments
 (0)