From c7a4e56ea5a8bb470ce13411c8bf8c0356d4427e Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 13 May 2020 12:25:47 -0400 Subject: [PATCH] Add compatibility with 1.34 in test suite Previously, this moved values into match guards, which was only recently allowed. See https://github.com/rust-lang/rust/pull/63118/ for more details. Note that this does _not_ allow the test suite to be run with 1.34, since its dependencies use features that were not stable in 1.34. --- src/simple_api/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simple_api/mod.rs b/src/simple_api/mod.rs index 6f6fb0f..cb5f97d 100644 --- a/src/simple_api/mod.rs +++ b/src/simple_api/mod.rs @@ -2449,8 +2449,8 @@ pub(crate) mod tests { Ok(TransactionStatus::Ok) } let err = call_forever(YDB_NOTTP).unwrap_err(); - match err.downcast::() { - Ok(err) if err.status == craw::YDB_ERR_TPTOODEEP => {} + match &err.downcast::() { + Ok(ydb_err) if ydb_err.status == craw::YDB_ERR_TPTOODEEP => {} other => panic!("expected ERR_TPTOODEEP, got {:?}", other), } @@ -2648,10 +2648,10 @@ pub(crate) mod tests { fn no_invalid_errors_proptest(key in arb_key(), value: Vec, b: bool) { fn assert_not_invalid(res: YDBResult) { match res { - Err(ydberr) if ydberr.status == YDB_ERR_INVSTRLEN => { + Err(YDBError { status: YDB_ERR_INVSTRLEN, .. }) => { panic!("function returned YDB_ERR_INVSTRLEN"); } - Err(ydberr) if ydberr.status == YDB_ERR_INSUFFSUBS => { + Err(YDBError { status: YDB_ERR_INSUFFSUBS, .. }) => { panic!("function returned YDB_ERR_INVSTRLEN"); } _ => {}