Skip to content

refactor: remove process::exit from library code, return Result instead#7

Open
duna-feline wants to merge 1 commit intomainfrom
fix/remove-process-exit
Open

refactor: remove process::exit from library code, return Result instead#7
duna-feline wants to merge 1 commit intomainfrom
fix/remove-process-exit

Conversation

@duna-feline
Copy link
Copy Markdown
Collaborator

Changes

  • Remove all 5 std::process::exit(1) calls from src/config.rs
  • RLLVMConfig::new() and load_path() now return Result<Self, Error>
  • New try_default() fallible method extracted from Default::default()
  • Added ConfigError(String) variant to Error enum
  • Panic boundary pushed to rllvm_config() OnceLock init (appropriate for global singleton)
  • Binary files unchanged — process::exit is fine there

Why

Library code should never call process::exit() — it prevents callers from handling errors gracefully. This is especially important for users who may want to use rllvm as a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant