paths: Replace lazy_static! with OnceLock (#13213)

This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-06-18 12:22:37 -04:00 committed by GitHub
parent ba59e66314
commit 81475ac4cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 322 additions and 172 deletions

View file

@ -509,7 +509,7 @@ impl Client {
let credentials_provider: Arc<dyn CredentialsProvider + Send + Sync + 'static> =
if use_zed_development_auth {
Arc::new(DevelopmentCredentialsProvider {
path: paths::CONFIG_DIR.join("development_auth"),
path: paths::config_dir().join("development_auth"),
})
} else {
Arc::new(KeychainCredentialsProvider)

View file

@ -223,7 +223,7 @@ impl Telemetry {
let state = state.clone();
async move {
if let Some(tempfile) =
NamedTempFile::new_in(paths::CONFIG_DIR.as_path()).log_err()
NamedTempFile::new_in(paths::config_dir().as_path()).log_err()
{
state.lock().log_file = Some(tempfile);
}