Skip to content

Commit 4d050fe

Browse files
authored
Apply clippy suggestions (#27)
1 parent c28cb83 commit 4d050fe

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

server/src/handlers/logstream.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,13 @@ pub async fn put_alert(req: HttpRequest, body: web::Json<serde_json::Value>) ->
244244
}
245245
.to_http(),
246246
},
247-
Err(e) => {
248-
return response::ServerResponse {
249-
msg: format!(
250-
"failed to set alert configuration for log stream {} due to err: {}",
251-
stream_name, e
252-
),
253-
code: StatusCode::BAD_REQUEST,
254-
}
255-
.to_http();
247+
Err(e) => response::ServerResponse {
248+
msg: format!(
249+
"failed to set alert configuration for log stream {} due to err: {}",
250+
stream_name, e
251+
),
252+
code: StatusCode::BAD_REQUEST,
256253
}
254+
.to_http(),
257255
}
258256
}

server/src/validator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ const DENIED_NAMES: &[&str] = &[
2828
"select", "from", "where", "group", "by", "order", "limit", "offset", "join", "and",
2929
];
3030

31-
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
31+
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
3232
#[serde(rename_all = "camelCase")]
3333
pub struct Alerts {
3434
pub alerts: Vec<Alert>,
3535
}
3636

37-
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
37+
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
3838
#[serde(rename_all = "camelCase")]
3939
pub struct Alert {
4040
pub name: String,
@@ -43,7 +43,7 @@ pub struct Alert {
4343
pub target: Vec<Target>,
4444
}
4545

46-
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
46+
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4747
#[serde(rename_all = "camelCase")]
4848
pub struct Rule {
4949
pub field: String,
@@ -52,7 +52,7 @@ pub struct Rule {
5252
pub within: String,
5353
}
5454

55-
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
55+
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
5656
#[serde(rename_all = "camelCase")]
5757
pub struct Target {
5858
pub name: String,

0 commit comments

Comments
 (0)