From 1f4adc5ba6f53d800f59065ca83810a7187121d3 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 15 Jun 2020 09:58:49 +0200 Subject: [PATCH] Oh cool, is_none() exists --- implementations/rust/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementations/rust/src/lib.rs b/implementations/rust/src/lib.rs index 33ff756..83fdc52 100644 --- a/implementations/rust/src/lib.rs +++ b/implementations/rust/src/lib.rs @@ -279,7 +279,7 @@ mod decoder_tests { assert_eq!(d.read.source.index, 6); assert_eq!(d.demand_next().unwrap().value(), &Value::simple_record("Pong", vec![])); assert_eq!(d.read.source.index, 12); - assert!(if let None = d.next() { true } else { false }); + assert!(d.next().is_none()); assert!(if let Err(e) = d.demand_next() { is_eof_io_error(&e) } else { false }); } @@ -579,7 +579,7 @@ mod samples_tests { }) } TestCase::DecodeEOF(ref bin) => { - assert!(if let None = decoder::from_bytes(bin).next() { true } else { false }) + assert!(decoder::from_bytes(bin).next().is_none()); } } }