mirror of
https://github.com/openai/codex.git
synced 2026-09-08 15:50:34 +00:00
Avoid expect in local environment lookup
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -115,8 +115,10 @@ impl EnvironmentManager {
|
||||
|
||||
/// Returns the local environment instance used for internal runtime work.
|
||||
pub fn local_environment(&self) -> Arc<Environment> {
|
||||
self.get_environment(LOCAL_ENVIRONMENT_ID)
|
||||
.expect("EnvironmentManager always has a local environment")
|
||||
match self.get_environment(LOCAL_ENVIRONMENT_ID) {
|
||||
Some(environment) => environment,
|
||||
None => unreachable!("EnvironmentManager always has a local environment"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a named environment instance.
|
||||
|
||||
Reference in New Issue
Block a user