This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 7df054b
committed
Change return type of unstable
The advantage of this is that it does not need to be assigned to a
variable to be used in a `Context` creation, which is the most common
thing to want to do with a noop waker.
If an owned noop waker is desired, it can be created by cloning, but the
reverse is harder. Alternatively, both versions could be provided, like
`futures::task::noop_waker()` and `futures::task::noop_waker_ref()`, but
that seems to me to be API clutter for a very small benefit, whereas
having the `&'static` reference available is a large benefit.
Previous discussion on the tracking issue starting here:
rust-lang#98286 (comment)Waker::noop() from Waker to &Waker.1 parent 3deb9bb commit 7df054b
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| |||
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
346 | | - | |
347 | | - | |
| 348 | + | |
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | | - | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
| |||
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| 368 | + | |
367 | 369 | | |
368 | | - | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
0 commit comments