Skip to content

Commit 2088b8a

Browse files
committed
CI fixes
1 parent 1d39c80 commit 2088b8a

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ serde_yaml = "^0.9"
1818
serde = { version = "1.0.228", features = ["derive"] }
1919
ureq = { version = "3", optional = true }
2020
actix-web = { version = "4", optional = true, default-features = false }
21-
actix-rt = { version = "2", optional = true, default-features = false }
21+
actix-rt = { version = "2", optional = true, default-features = false, features = ["macros"] }
2222
tokio = { version = "1", optional = true, default-features = false }
2323

2424
[dev-dependencies]

cli/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ enum Commands {
8181
ToOpenApi(to_openapi::ToOpenApiArgs),
8282
/// Expose CLI interface as JSON-RPC server over HTTP.
8383
#[clap(name = "serve_json_rpc")]
84-
#[cfg(feature = "server")]
84+
#[cfg(feature = "server")]
8585
ServerJsonRpc(server_json_rpc::ServerJsonRpcArgs),
8686
#[cfg(not(feature = "server"))]
8787
ServerJsonRpc,
@@ -117,13 +117,15 @@ fn main() -> AppResult<()> {
117117
Commands::ToOpenApi(args) => {
118118
to_openapi::execute(args, &cli.target)?;
119119
}
120-
#[cfg(feature = "server")]
120+
#[cfg(feature = "server")]
121121
Commands::ServerJsonRpc(args) => {
122122
server_json_rpc::execute(args)?;
123123
}
124124
#[cfg(not(feature = "server"))]
125125
Commands::ServerJsonRpc => {
126-
return Err(cdd_core::error::AppError::General("Server feature is not compiled".to_string()));
126+
return Err(cdd_core::error::AppError::General(
127+
"Server feature is not compiled".to_string(),
128+
));
127129
}
128130
}
129131

cli/src/to_docs_json.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ struct DocsCode {
5050
wrapper_end: Option<String>,
5151
}
5252

53-
54-
5553
#[cfg(not(tarpaulin_include))]
5654
#[cfg(feature = "client")]
5755
fn read_input(input: &str) -> AppResult<String> {
5856
if input.starts_with("http://") || input.starts_with("https://") {
59-
let mut response = ureq::get(input)
57+
let response = ureq::get(input)
6058
.call()
6159
.map_err(|e| AppError::General(format!("Failed to fetch URL: {}", e)))?;
62-
response.into_string().map_err(|e| AppError::General(format!("Failed to read HTTP body: {}", e)))
60+
response
61+
.into_body()
62+
.read_to_string()
63+
.map_err(|e| AppError::General(format!("Failed to read HTTP body: {}", e)))
6364
} else {
6465
std::fs::read_to_string(input)
6566
.map_err(|e| AppError::General(format!("Failed to read file: {}", e)))
@@ -70,7 +71,9 @@ fn read_input(input: &str) -> AppResult<String> {
7071
#[cfg(not(feature = "client"))]
7172
fn read_input(input: &str) -> AppResult<String> {
7273
if input.starts_with("http://") || input.starts_with("https://") {
73-
Err(AppError::General("Client feature is not compiled, cannot fetch HTTP URLs".to_string()))
74+
Err(AppError::General(
75+
"Client feature is not compiled, cannot fetch HTTP URLs".to_string(),
76+
))
7477
} else {
7578
std::fs::read_to_string(input)
7679
.map_err(|e| AppError::General(format!("Failed to read file: {}", e)))

0 commit comments

Comments
 (0)