fix: clippy

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2023-07-27 12:39:31 +02:00
parent 05085229be
commit d60cdf9cdb
Signed by: harald
GPG key ID: 900F3C4971086004
7 changed files with 14 additions and 13 deletions

View file

@ -18,13 +18,13 @@ fn test_iter() -> Result<(), Box<dyn Error + Send + Sync>> {
let mut res = String::new();
for e in err.iter() {
write!(res, "{}", e.to_string())?;
write!(res, "{}", e)?;
}
assert_eq!(res, "654321entity not found");
let io_error: Option<&io::Error> = err
.iter()
.filter_map(Error::downcast_ref::<io::Error>)
.filter_map(<dyn Error>::downcast_ref::<io::Error>)
.next();
assert_eq!(io_error.unwrap().kind(), io::ErrorKind::NotFound);
@ -50,7 +50,7 @@ fn test_iter() -> Result<(), Box<dyn Error + Send + Sync>> {
let io_error: Option<&io::Error> = err
.iter()
.filter_map(Error::downcast_ref::<io::Error>)
.filter_map(<dyn Error>::downcast_ref::<io::Error>)
.next();
assert_eq!(io_error.unwrap().kind(), io::ErrorKind::NotFound);
@ -88,7 +88,7 @@ fn test_root_cause() -> Result<(), Box<dyn Error + Send + Sync>> {
let err = err.err().unwrap();
let err: Option<&(dyn std::error::Error + 'static)> = err.root_cause();
let io_error: Option<&io::Error> = err.and_then(Error::downcast_ref::<io::Error>);
let io_error: Option<&io::Error> = err.and_then(<dyn Error>::downcast_ref::<io::Error>);
assert_eq!(io_error.unwrap().kind(), io::ErrorKind::NotFound);