Skip to content

Commit 9178bfb

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 0cca9c8 commit 9178bfb

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
@@ -933,7 +933,7 @@ where
933933
//
934934
// Intentionally create the span outside the task to set the parent.
935935
let expire_span = debug_span!("drop::expire");
936-
let _ = handle.spawn_named(
936+
handle.spawn_named(
937937
|| format!("ReadHandle::expire ({})", self.reader_id),
938938
async move {
939939
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
@@ -739,7 +739,7 @@ where
739739
//
740740
// Intentionally create the span outside the task to set the parent.
741741
let expire_span = debug_span!("drop::expire");
742-
let _ = handle.spawn_named(
742+
handle.spawn_named(
743743
|| format!("WriteHandle::expire ({})", self.writer_id),
744744
async move {
745745
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)