Skip to content

Commit 7f78686

Browse files
committed
coderabbit changes
1 parent 4ac74dc commit 7f78686

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/alerts/alert_structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl AlertRequest {
273273

274274
if datasets.len() != 1 {
275275
return Err(AlertError::ValidationFailure(format!(
276-
"Query should include only one dataset. Found- {datasets:?}"
276+
"Query should include only one dataset. Found: {datasets:?}"
277277
)));
278278
}
279279

src/handlers/http/cluster/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl StorageStats {
135135
}
136136
}
137137

138-
pub fn merge_quried_stats(stats: Vec<QueriedStats>) -> QueriedStats {
138+
pub fn merge_queried_stats(stats: Vec<QueriedStats>) -> QueriedStats {
139139
// get the stream name
140140
let stream_name = stats[1].stream.clone();
141141

src/handlers/http/modal/query/querier_logstream.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::{
3939
base_path_without_preceding_slash,
4040
cluster::{
4141
self, fetch_daily_stats, fetch_stats_from_ingestors, sync_streams_with_ingestors,
42-
utils::{IngestionStats, QueriedStats, StorageStats, merge_quried_stats},
42+
utils::{IngestionStats, QueriedStats, StorageStats, merge_queried_stats},
4343
},
4444
logstream::error::StreamError,
4545
modal::{NodeMetadata, NodeType},
@@ -118,7 +118,7 @@ pub async fn put_stream(
118118
body: Bytes,
119119
) -> Result<impl Responder, StreamError> {
120120
let stream_name = stream_name.into_inner();
121-
let _ = CREATE_STREAM_LOCK.lock().await;
121+
let _guard = CREATE_STREAM_LOCK.lock().await;
122122
let headers = PARSEABLE
123123
.create_update_stream(req.headers(), &body, &stream_name)
124124
.await?;
@@ -134,7 +134,7 @@ pub async fn put_stream(
134134
if is_update {
135135
Ok(("Log stream updated", StatusCode::OK))
136136
} else {
137-
Ok(("Log stream created", StatusCode::OK))
137+
Ok(("Log stream created", StatusCode::CREATED))
138138
}
139139
}
140140

@@ -231,7 +231,7 @@ pub async fn get_stats(
231231

232232
let stats = if let Some(mut ingestor_stats) = ingestor_stats {
233233
ingestor_stats.push(stats);
234-
merge_quried_stats(ingestor_stats)
234+
merge_queried_stats(ingestor_stats)
235235
} else {
236236
stats
237237
};

src/prism/logstream/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::{
3030
handlers::http::{
3131
cluster::{
3232
fetch_stats_from_ingestors,
33-
utils::{IngestionStats, QueriedStats, StorageStats, merge_quried_stats},
33+
utils::{IngestionStats, QueriedStats, StorageStats, merge_queried_stats},
3434
},
3535
logstream::error::StreamError,
3636
query::{QueryError, update_schema_when_distributed},
@@ -136,7 +136,7 @@ async fn get_stats(stream_name: &str) -> Result<QueriedStats, PrismLogstreamErro
136136

137137
let stats = if let Some(mut ingestor_stats) = ingestor_stats {
138138
ingestor_stats.push(stats);
139-
merge_quried_stats(ingestor_stats)
139+
merge_queried_stats(ingestor_stats)
140140
} else {
141141
stats
142142
};

src/query/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use crate::catalog::Snapshot as CatalogSnapshot;
5656
use crate::catalog::column::{Int64Type, TypedStatistics};
5757
use crate::catalog::manifest::Manifest;
5858
use crate::catalog::snapshot::Snapshot;
59-
use crate::event::{self, DEFAULT_TIMESTAMP_KEY};
59+
use crate::event::DEFAULT_TIMESTAMP_KEY;
6060
use crate::handlers::http::query::QueryError;
6161
use crate::option::Mode;
6262
use crate::parseable::PARSEABLE;
@@ -345,7 +345,7 @@ impl CountsRequest {
345345
.get_stream(&self.stream)
346346
.map_err(|err| anyhow::Error::msg(err.to_string()))?
347347
.get_time_partition()
348-
.unwrap_or(event::DEFAULT_TIMESTAMP_KEY.to_owned());
348+
.unwrap_or_else(|| DEFAULT_TIMESTAMP_KEY.to_owned());
349349

350350
// get time range
351351
let time_range = TimeRange::parse_human_time(&self.start_time, &self.end_time)?;
@@ -449,7 +449,7 @@ impl CountsRequest {
449449
let time_partition = PARSEABLE
450450
.get_stream(&self.stream)?
451451
.get_time_partition()
452-
.unwrap_or(DEFAULT_TIMESTAMP_KEY.into());
452+
.unwrap_or_else(|| DEFAULT_TIMESTAMP_KEY.into());
453453

454454
let time_range = TimeRange::parse_human_time(&self.start_time, &self.end_time)?;
455455

0 commit comments

Comments
 (0)