1
Fork 0

Rollup merge of #120976 - matthiaskrgr:constify_TL_statics, r=lcnr

constify a couple thread_local statics
This commit is contained in:
Matthias Krüger 2024-03-04 22:16:30 +01:00 committed by GitHub
commit 706fe0b7d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -42,7 +42,7 @@ pub struct Registry(Arc<RegistryData>);
thread_local! {
/// The registry associated with the thread.
/// This allows the `WorkerLocal` type to clone the registry in its constructor.
static REGISTRY: OnceCell<Registry> = OnceCell::new();
static REGISTRY: OnceCell<Registry> = const { OnceCell::new() };
}
struct ThreadData {

View file

@ -9,9 +9,9 @@ const DEFAULT_COLUMN_WIDTH: usize = 140;
thread_local! {
/// Track the position of viewable characters in our buffer
static CURSOR: Cell<usize> = Cell::new(0);
static CURSOR: Cell<usize> = const { Cell::new(0) };
/// Width of the terminal
static WIDTH: Cell<usize> = Cell::new(DEFAULT_COLUMN_WIDTH);
static WIDTH: Cell<usize> = const { Cell::new(DEFAULT_COLUMN_WIDTH) };
}
/// Print to terminal output to a buffer