Skip to content
Myr

Simplify nonbool ensure test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 3f9c220 · Browse files · 1 file+5 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−7 removed

  • tests:+5 added−7 removed

1 file+5 added−7 removed

modified:tests/test_macros.rs+5 added-7 removed
53 unmodified lines
54 );55}5657#[test]58fn test_ensure_nonbool() {58fn test_ensure_nonbool() -> Result<()> {59 struct Struct {60 condition: bool,61 }6263 fn f(s: &Struct) -> Result<()> {64 match s {65 Struct { condition } => ensure!(condition), // &bool66 }67 Ok(())63 let s = Struct { condition: true };64 match &s {65 Struct { condition } => ensure!(condition), // &bool66 }6770 f(&Struct { condition: true }).unwrap();68 Ok(())69}7071#[test]72fn test_temporaries() {
24 unmodified lines