mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
This commit imports libcore 1.49.0 into a new directory, "libgrust/rustc-lib/core". LICENSE-* files are taken from the rustc 1.49.0 repository root. libgrust/ChangeLog: * rustc-lib/LICENSE-APACHE: New file. * rustc-lib/LICENSE-MIT: New file. * rustc-lib/version-info: New file. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
8 lines
205 B
Rust
8 lines
205 B
Rust
#[test]
|
|
fn test_bool_to_option() {
|
|
assert_eq!(false.then_some(0), None);
|
|
assert_eq!(true.then_some(0), Some(0));
|
|
assert_eq!(false.then(|| 0), None);
|
|
assert_eq!(true.then(|| 0), Some(0));
|
|
}
|