Skip to content

Commit b9a16b3

Browse files
committed
storage: don't assign JoinHandles to _
Assigning the `JoinHandle` returned by `spawn` to `_` triggers a the clippy lint `let_underscore_future`. This is a known FP (see rust-lang/rust-clippy#9932). The easiest way to avoid it is to not do that assignment.
1 parent 4e83164 commit b9a16b3

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/persist-client/examples/maelstrom/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
};
126126

127127
let service = Arc::clone(&self.service);
128-
let _ = mz_ore::task::spawn(|| "maelstrom::handle".to_string(), async move {
128+
mz_ore::task::spawn(|| "maelstrom::handle".to_string(), async move {
129129
let service = service.get().await;
130130
let () = service.eval(handle, msg.src, body).await;
131131
});
@@ -164,7 +164,7 @@ where
164164
// the AsyncInitOnceWaitable nonsense.
165165
let args = self.args.clone();
166166
let service_init = Arc::clone(&self.service);
167-
let _ = mz_ore::task::spawn(|| "maelstrom::init".to_string(), async move {
167+
mz_ore::task::spawn(|| "maelstrom::init".to_string(), async move {
168168
let service = match S::init(&args, &handle).await {
169169
Ok(x) => x,
170170
Err(err) => {

src/persist-client/src/internal/compact.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ where
149149
let compact_span =
150150
debug_span!(parent: None, "compact::apply", shard_id=%machine.shard_id());
151151
compact_span.follows_from(&Span::current());
152-
let _ = mz_ore::task::spawn(|| "PersistCompactionWorker", async move {
152+
mz_ore::task::spawn(|| "PersistCompactionWorker", async move {
153153
let res = Self::compact_and_apply(
154154
cfg,
155155
blob,

src/persist-client/src/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ where
930930
//
931931
// Intentionally create the span outside the task to set the parent.
932932
let expire_span = debug_span!("drop::expire");
933-
let _ = handle.spawn_named(
933+
handle.spawn_named(
934934
|| format!("ReadHandle::expire ({})", self.reader_id),
935935
async move {
936936
machine.expire_leased_reader(&reader_id).await;

src/persist-client/src/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ where
735735
//
736736
// Intentionally create the span outside the task to set the parent.
737737
let expire_span = debug_span!("drop::expire");
738-
let _ = handle.spawn_named(
738+
handle.spawn_named(
739739
|| format!("WriteHandle::expire ({})", self.writer_id),
740740
async move {
741741
machine.expire_writer(&writer_id).await;

src/storage/src/source/commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub(crate) fn drive_offset_committer<S: OffsetCommitter + Send + Sync + 'static>
6666
) -> OffsetCommitHandle {
6767
let (tx, mut rx): (_, watch::Receiver<HashMap<PartitionId, MzOffset>>) =
6868
watch::channel(Default::default());
69-
let _ = task::spawn(
69+
task::spawn(
7070
|| format!("offset commiter({source_id}) {worker_id}/{worker_count}"),
7171
async move {
7272
let mut last_offsets: HashMap<PartitionId, MzOffset> = HashMap::new();

0 commit comments

Comments
 (0)