Fix warnings for Rust 1.51 (#3214)

* Fix warnings for Rust 1.51

* More fixes

* More fixes
This commit is contained in:
Jonathan Turner
2021-03-26 21:26:57 +13:00
committed by GitHub
parent 589fc0b8ad
commit 7e184b58b2
55 changed files with 325 additions and 400 deletions

View File

@ -14,24 +14,21 @@ mod tests {
pub fn expect_action(&self, action: Action) {
match &self.action {
Some(set) if set == &action => {}
Some(other) => panic!(format!("\nExpected {:#?}\n\ngot {:#?}", action, other)),
None => panic!(format!("\nAction {:#?} not found.", action)),
Some(_) => panic!("\nUnexpected action"),
None => panic!("\nAction not found."),
}
}
pub fn expect_field(&self, field: Value) {
let field = match field.as_column_path() {
Ok(column_path) => column_path,
Err(reason) => panic!(format!(
"\nExpected {:#?} to be a ColumnPath, \n\ngot {:#?}",
field, reason
)),
Err(_) => panic!("\nExpected a ColumnPath",),
};
match &self.field {
Some(column_path) if column_path == &field => {}
Some(other) => panic!(format!("\nExpected {:#?} \n\ngot {:#?}", field, other)),
None => panic!(format!("\nField {:#?} not found.", field)),
Some(_) => panic!("\nUnexpected field."),
None => panic!("\nField not found."),
}
}
}