mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
9 lines
210 B
Rust
9 lines
210 B
Rust
pub fn add_options(a: Option<i32>, b: Option<i32>) -> Option<i32> {
|
|
// let chains only allowed in Rust 2024
|
|
if let Some(a) = a && let Some(b) = b {
|
|
Some(a + b)
|
|
} else {
|
|
None
|
|
}
|
|
}
|