From a727067a7d78f843051e24bcc774d60cd76ce43c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 9 Oct 2019 18:43:49 -0700 Subject: [PATCH] Format with rustfmt 2019-09-08 --- src/error.rs | 12 +++++++++--- tests/test_downcast.rs | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/error.rs b/src/error.rs index d9b6eda..196e75a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -233,7 +233,9 @@ impl Error { if self.is::() { let outer = ManuallyDrop::new(self); unsafe { - let error = ptr::read(outer.inner.error() as *const (dyn StdError + Send + Sync) as *const E); + let error = ptr::read( + outer.inner.error() as *const (dyn StdError + Send + Sync) as *const E + ); let inner = ptr::read(&outer.inner); let erased = ManuallyDrop::into_inner(inner); (erased.vtable.object_drop_front)(erased); @@ -285,7 +287,9 @@ impl Error { E: Display + Debug + Send + Sync + 'static, { if self.is::() { - Some(unsafe { &*(self.inner.error() as *const (dyn StdError + Send + Sync) as *const E) }) + Some(unsafe { + &*(self.inner.error() as *const (dyn StdError + Send + Sync) as *const E) + }) } else { None } @@ -297,7 +301,9 @@ impl Error { E: Display + Debug + Send + Sync + 'static, { if self.is::() { - Some(unsafe { &mut *(self.inner.error_mut() as *mut (dyn StdError + Send + Sync) as *mut E) }) + Some(unsafe { + &mut *(self.inner.error_mut() as *mut (dyn StdError + Send + Sync) as *mut E) + }) } else { None } diff --git a/tests/test_downcast.rs b/tests/test_downcast.rs index ac1bd51..548fd06 100644 --- a/tests/test_downcast.rs +++ b/tests/test_downcast.rs @@ -94,5 +94,8 @@ fn test_large_alignment() { impl StdError for LargeAlignedError {} let error = Error::new(LargeAlignedError("oh no!")); - assert_eq!("oh no!", error.downcast_ref::().unwrap().0); + assert_eq!( + "oh no!", + error.downcast_ref::().unwrap().0 + ); }