Skip to content

Commit fe0d3af

Browse files
committed
Fix clippy warnings
1 parent 7b0dbec commit fe0d3af

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

quickwit/quickwit-cli/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl RunCliCommand {
8585

8686
if let Some(services) = &self.services {
8787
info!(services = %services.iter().join(", "), "setting services from override");
88-
node_config.enabled_services = services.clone();
88+
node_config.enabled_services.clone_from(services);
8989
}
9090
let telemetry_handle_opt =
9191
quickwit_telemetry::start_telemetry_loop(quickwit_telemetry_info(&node_config));

quickwit/quickwit-control-plane/src/debouncer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl Debouncer {
118118

119119
pub fn self_send_with_cooldown<M>(
120120
&self,
121-
ctx: &ActorContext<impl Actor + Handler<M> + DeferableReplyHandler<M>>,
121+
ctx: &ActorContext<impl Handler<M> + DeferableReplyHandler<M>>,
122122
) where
123123
M: Default + std::fmt::Debug + Send + Sync + 'static,
124124
{

quickwit/quickwit-indexing/src/actors/indexing_pipeline.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl IndexingPipeline {
264264
.set_num_spawn_attempts(self.statistics.num_spawn_attempts);
265265
let pipeline_metrics_opt = handles.indexer.last_observation().pipeline_metrics_opt;
266266
self.statistics.pipeline_metrics_opt = pipeline_metrics_opt;
267-
self.statistics.shard_ids = self.shard_ids.clone();
267+
self.statistics.shard_ids.clone_from(&self.shard_ids);
268268
ctx.observe(self);
269269
}
270270

@@ -543,7 +543,8 @@ impl Handler<AssignShards> for IndexingPipeline {
543543
assign_shards_message: AssignShards,
544544
ctx: &ActorContext<Self>,
545545
) -> Result<(), ActorExitStatus> {
546-
self.shard_ids = assign_shards_message.0.shard_ids.clone();
546+
self.shard_ids
547+
.clone_from(&assign_shards_message.0.shard_ids);
547548
// If the pipeline is running, we forward the message to its source.
548549
// If it is not, it will be respawned soon, and the shards will be assigned afterward.
549550
if let Some(handles) = &mut self.handles_opt {

quickwit/quickwit-integration-tests/src/test_utils/cluster_sandbox.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ pub fn build_node_configs(
413413
let unique_dir_name = new_coolid("test-dir");
414414
for (node_idx, node_services) in nodes_services.iter().enumerate() {
415415
let mut config = NodeConfig::for_test();
416-
config.enabled_services = node_services.clone();
417-
config.cluster_id = cluster_id.clone();
416+
config.enabled_services.clone_from(node_services);
417+
config.cluster_id.clone_from(&cluster_id);
418418
config.node_id = NodeId::new(format!("test-node-{node_idx}"));
419419
config.data_dir_path = root_data_dir.join(config.node_id.as_str());
420420
config.metastore_uri =

quickwit/quickwit-metastore/src/metastore/postgres/pool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ where for<'c> &'c mut DB::Connection: Executor<'c, Database = DB>
8686
{
8787
type Database = DB;
8888

89-
fn fetch_many<'e, 'q: 'e, E: 'q>(
89+
fn fetch_many<'e, 'q: 'e, E>(
9090
self,
9191
query: E,
9292
) -> BoxStream<'e, Result<Either<DB::QueryResult, DB::Row>, Error>>
9393
where
94-
E: Execute<'q, Self::Database>,
94+
E: Execute<'q, Self::Database> + 'q,
9595
{
9696
self.inner_pool.fetch_many(query)
9797
}
9898

99-
fn fetch_optional<'e, 'q: 'e, E: 'q>(
99+
fn fetch_optional<'e, 'q: 'e, E>(
100100
self,
101101
query: E,
102102
) -> BoxFuture<'e, Result<Option<DB::Row>, Error>>
103103
where
104-
E: Execute<'q, Self::Database>,
104+
E: Execute<'q, Self::Database> + 'q,
105105
{
106106
self.inner_pool.fetch_optional(query)
107107
}

quickwit/quickwit-search/src/scroll_context.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

2020
use std::collections::HashMap;
21+
use std::fmt;
2122
use std::ops::Range;
2223
use std::str::FromStr;
2324
use std::sync::Arc;
@@ -192,15 +193,16 @@ impl ScrollKeyAndStartOffset {
192193
}
193194
}
194195

195-
impl ToString for ScrollKeyAndStartOffset {
196-
fn to_string(&self) -> String {
196+
impl fmt::Display for ScrollKeyAndStartOffset {
197+
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
197198
let mut payload = vec![0u8; 28];
198199
payload[..16].copy_from_slice(&u128::from(self.scroll_ulid).to_le_bytes());
199200
payload[16..24].copy_from_slice(&self.start_offset.to_le_bytes());
200201
payload[24..28].copy_from_slice(&self.max_hits_per_page.to_le_bytes());
201202
serde_json::to_writer(&mut payload, &self.search_after)
202203
.expect("serializing PartialHit should never fail");
203-
BASE64_STANDARD.encode(payload)
204+
let b64_payload = BASE64_STANDARD.encode(payload);
205+
write!(formatter, "{}", b64_payload)
204206
}
205207
}
206208

0 commit comments

Comments
 (0)