static mut
is ALWAYS a mistake
#151
Labels
adequate
Satisfactory and useful change, issue, discussion
enhancement
New feature or request
rust
Backend (Rust) related
Lazap/src-tauri/src/addons/spotify.rs
Lines 17 to 26 in 151995e
There are several preferable options here:
std::sync::OnceLock
, a safe way to ensure a global variable is initialized at most once, and then is read-only forever afterwards.actix_web::web::Data
, the standard way to pass data dynamically into a request handlerArc<Mutex<T>>
to pass the data around. This should be your last resort.The text was updated successfully, but these errors were encountered: