1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// SPDX-License-Identifier: Apache-2.0
//! main_result — return `Result<(), E>` from `main` via `go_lib::run`.
//!
//! Pattern: the closure returns `Result`; `main` returns the same `Result`.
//! The `?` operator works naturally inside the closure, and Rust's built-in
//! `Termination` trait prints the error and sets exit code 1 on `Err`.
//!
//! `go_lib::scope` parses every string concurrently. Each goroutine borrows its
//! `&str` directly from the `inputs` slice — no channel or `Arc` required.
//! `h.join().unwrap()?` unwraps the panic wrapper and then propagates any
//! `ParseIntError` with `?`.
//!
//! ```sh
//! cargo run --example main_result
//! ```
use ParseIntError;