Skip to content

Commit

Permalink
Re-adding LazyConfig::is_init for use in cwd changing code
Browse files Browse the repository at this point in the history
  • Loading branch information
compenguy committed Feb 1, 2023
1 parent a40a64b commit 5e4f035
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ impl LazyConfig {
Self { config: None }
}

/// Check whether the config is loaded
///
/// This is useful for asserts in case the environment needs to be setup before loading
pub fn is_init(&self) -> bool {
self.config.is_some()
}

/// Get the config, loading it if needed
///
/// On error, the process is terminated
Expand Down

0 comments on commit 5e4f035

Please sign in to comment.