Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 67faa29

Browse files
committed
fix clippy warnings
1 parent 2c8e661 commit 67faa29

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/app/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use serde_json::{self as encoder, Value};
44
use std::collections::HashMap;
55
use std::path::{Path, PathBuf};
66
use std::sync::atomic::{AtomicU64, Ordering};
7-
use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufStream};
7+
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufStream};
88
use tokio::net::UnixStream;
99

10-
use super::server::{Status, ZinitResponse, ZinitState};
10+
use super::server::Status;
1111

1212
// JSON-RPC 2.0 structures
1313
#[derive(Debug, Deserialize, Serialize)]
@@ -105,7 +105,7 @@ impl Client {
105105
let data = data.trim_end();
106106

107107
// Parse the JSON-RPC response - improved error handling
108-
let response: JsonRpcResponse = match encoder::from_str(&data) {
108+
let response: JsonRpcResponse = match encoder::from_str(data) {
109109
Ok(response) => response,
110110
Err(e) => {
111111
// If we can't parse the response as JSON-RPC, this is an error

src/app/server.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde_json::{self as encoder, Value};
66
use std::collections::HashMap;
77
use std::path::{Path, PathBuf};
88
use std::str::FromStr;
9-
use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufStream};
9+
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufStream};
1010
use tokio::net::{UnixListener, UnixStream};
1111

1212
// Include the OpenRPC specification
@@ -295,7 +295,7 @@ impl Api {
295295
if let Some(params) = &request.params {
296296
if let Some(name) = params.get("name").and_then(|v| v.as_str()) {
297297
if let Some(content) = params.get("content").and_then(|v| v.as_object()) {
298-
Api::create_service(name, content, zinit).await
298+
Api::create_service(name, content).await
299299
} else {
300300
Err(anyhow::anyhow!("Missing or invalid 'content' parameter"))
301301
}
@@ -310,7 +310,7 @@ impl Api {
310310
"service.delete" => {
311311
if let Some(params) = &request.params {
312312
if let Some(name) = params.get("name").and_then(|v| v.as_str()) {
313-
Api::delete_service(name, zinit).await
313+
Api::delete_service(name).await
314314
} else {
315315
Err(anyhow::anyhow!("Missing or invalid 'name' parameter"))
316316
}
@@ -322,7 +322,7 @@ impl Api {
322322
"service.get" => {
323323
if let Some(params) = &request.params {
324324
if let Some(name) = params.get("name").and_then(|v| v.as_str()) {
325-
Api::get_service(name, zinit).await
325+
Api::get_service(name).await
326326
} else {
327327
Err(anyhow::anyhow!("Missing or invalid 'name' parameter"))
328328
}
@@ -714,7 +714,6 @@ impl Api {
714714
async fn create_service<S: AsRef<str>>(
715715
name: S,
716716
content: &serde_json::Map<String, Value>,
717-
zinit: ZInit,
718717
) -> Result<Value> {
719718
use std::fs;
720719
use std::io::Write;
@@ -749,7 +748,7 @@ impl Api {
749748
)))
750749
}
751750

752-
async fn delete_service<S: AsRef<str>>(name: S, zinit: ZInit) -> Result<Value> {
751+
async fn delete_service<S: AsRef<str>>(name: S) -> Result<Value> {
753752
use std::fs;
754753

755754
let name = name.as_ref();
@@ -776,7 +775,7 @@ impl Api {
776775
)))
777776
}
778777

779-
async fn get_service<S: AsRef<str>>(name: S, zinit: ZInit) -> Result<Value> {
778+
async fn get_service<S: AsRef<str>>(name: S) -> Result<Value> {
780779
use std::fs;
781780

782781
let name = name.as_ref();

src/bin/zinit-http.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
extern crate zinit;
22

3-
use anyhow::{Context, Result};
3+
use anyhow::Result;
44
use clap::{App, Arg};
55
use git_version::git_version;
6-
use std::path::Path;
76
use zinit::app::client::Client;
87

98
const GIT_VERSION: &str = git_version!(args = ["--tags", "--always", "--dirty=-modified"]);

src/manager/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ impl ProcessManager {
170170

171171
let mut table = self.table.lock().await;
172172

173+
// FIXME: properly add child to `Child`-struct, so .wait() can be called
174+
#[allow(clippy::zombie_processes)]
173175
let mut child = child
174176
.group_spawn()
175177
.context("failed to spawn command")?

0 commit comments

Comments
 (0)