Skip to content

Commit

Permalink
Add compatibility with 1.34 in test suite
Browse files Browse the repository at this point in the history
Previously, this moved values into match guards, which was only recently allowed.
See rust-lang/rust#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.
  • Loading branch information
Joshua Nelson committed May 17, 2020
1 parent 19f3641 commit c7a4e56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/simple_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2449,8 +2449,8 @@ pub(crate) mod tests {
Ok(TransactionStatus::Ok)
}
let err = call_forever(YDB_NOTTP).unwrap_err();
match err.downcast::<YDBError>() {
Ok(err) if err.status == craw::YDB_ERR_TPTOODEEP => {}
match &err.downcast::<YDBError>() {
Ok(ydb_err) if ydb_err.status == craw::YDB_ERR_TPTOODEEP => {}
other => panic!("expected ERR_TPTOODEEP, got {:?}", other),
}

Expand Down Expand Up @@ -2648,10 +2648,10 @@ pub(crate) mod tests {
fn no_invalid_errors_proptest(key in arb_key(), value: Vec<u8>, b: bool) {
fn assert_not_invalid<T>(res: YDBResult<T>) {
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");
}
_ => {}
Expand Down

0 comments on commit c7a4e56

Please sign in to comment.