rust: Fix deprecation warnings

This commit is contained in:
Dorota Czaplejewicz
2020-09-21 09:43:32 +00:00
parent 6c5df02921
commit d93e9c2b11
2 changed files with 7 additions and 13 deletions

View File

@ -737,8 +737,7 @@ fn create_button<H: logging::Handler>(
#[cfg(test)]
mod tests {
use super::*;
use std::error::Error as ErrorTrait;
use ::logging::ProblemPanic;
const THIS_FILE: &str = file!();
@ -786,7 +785,8 @@ mod tests {
Err(e) => {
let mut handled = false;
if let Error::Yaml(ye) = &e {
handled = ye.description() == "missing field `views`";
handled = ye.to_string()
.starts_with("missing field `views`");
};
if !handled {
println!("Unexpected error {:?}", e);
@ -804,7 +804,7 @@ mod tests {
Err(e) => {
let mut handled = false;
if let Error::Yaml(ye) = &e {
handled = ye.description()
handled = ye.to_string()
.starts_with("unknown field `bad_field`");
};
if !handled {