alexcrichton / alexcrichton/scoped-tls
Example does not make it clear whether one can use short-lived references
Aperta
- Lingua principale
- Rust
- Stelle
- 65
- Fork
- 10
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The example uses `&1`, which (due to promotion) is a `&'static` reference. So the example code could easily be written with regular `std` `thread_local!`s. `static FOO: u32` also makes it look like the thread-local stores a value, not a reference.
I think the entire point of this crate is to allow thread-locals storing short-lived references, but the example doesn't really make that clear.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.