Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 0f89723

Browse files
committed
Reformat for latest rustfmt
1 parent 8f8f92f commit 0f89723

File tree

3 files changed

+25
-38
lines changed

3 files changed

+25
-38
lines changed

failure_derive/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ fn fail_derive(s: synstructure::Structure) -> TokenStream {
6565
(quote! {
6666
#fail
6767
#display
68-
}).into()
68+
})
69+
.into()
6970
}
7071

7172
fn display_body(s: &synstructure::Structure) -> Option<quote::__rt::TokenStream> {

failure_derive/tests/wraps.rs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ struct WrapError {
1818
fn wrap_error() {
1919
let inner = io::Error::from_raw_os_error(98);
2020
let err = WrapError { inner };
21-
assert!(
22-
err.cause()
23-
.and_then(|err| err.downcast_ref::<io::Error>())
24-
.is_some()
25-
);
21+
assert!(err
22+
.cause()
23+
.and_then(|err| err.downcast_ref::<io::Error>())
24+
.is_some());
2625
}
2726

2827
#[derive(Fail, Debug)]
@@ -33,11 +32,10 @@ struct WrapTupleError(#[fail(cause)] io::Error);
3332
fn wrap_tuple_error() {
3433
let io_error = io::Error::from_raw_os_error(98);
3534
let err: WrapTupleError = WrapTupleError(io_error);
36-
assert!(
37-
err.cause()
38-
.and_then(|err| err.downcast_ref::<io::Error>())
39-
.is_some()
40-
);
35+
assert!(err
36+
.cause()
37+
.and_then(|err| err.downcast_ref::<io::Error>())
38+
.is_some());
4139
}
4240

4341
#[derive(Fail, Debug)]
@@ -55,11 +53,10 @@ fn wrap_backtrace_error() {
5553
inner,
5654
backtrace: Backtrace::new(),
5755
};
58-
assert!(
59-
err.cause()
60-
.and_then(|err| err.downcast_ref::<io::Error>())
61-
.is_some()
62-
);
56+
assert!(err
57+
.cause()
58+
.and_then(|err| err.downcast_ref::<io::Error>())
59+
.is_some());
6360
assert!(err.backtrace().is_some());
6461
}
6562

@@ -79,21 +76,19 @@ enum WrapEnumError {
7976
fn wrap_enum_error() {
8077
let io_error = io::Error::from_raw_os_error(98);
8178
let err: WrapEnumError = WrapEnumError::Io(io_error);
82-
assert!(
83-
err.cause()
84-
.and_then(|err| err.downcast_ref::<io::Error>())
85-
.is_some()
86-
);
79+
assert!(err
80+
.cause()
81+
.and_then(|err| err.downcast_ref::<io::Error>())
82+
.is_some());
8783
assert!(err.backtrace().is_none());
8884
let fmt_error = fmt::Error::default();
8985
let err: WrapEnumError = WrapEnumError::Fmt {
9086
inner: fmt_error,
9187
backtrace: Backtrace::new(),
9288
};
93-
assert!(
94-
err.cause()
95-
.and_then(|err| err.downcast_ref::<fmt::Error>())
96-
.is_some()
97-
);
89+
assert!(err
90+
.cause()
91+
.and_then(|err| err.downcast_ref::<fmt::Error>())
92+
.is_some());
9893
assert!(err.backtrace().is_some());
9994
}

src/lib.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
#![cfg_attr(not(feature = "std"), no_std)]
2424
#![deny(missing_docs)]
2525
#![deny(warnings)]
26-
#![cfg_attr(
27-
feature = "small-error",
28-
feature(extern_types, allocator_api)
29-
)]
26+
#![cfg_attr(feature = "small-error", feature(extern_types, allocator_api))]
3027

3128
macro_rules! with_std { ($($i:item)*) => ($(#[cfg(feature = "std")]$i)*) }
3229
macro_rules! without_std { ($($i:item)*) => ($(#[cfg(not(feature = "std"))]$i)*) }
@@ -166,10 +163,7 @@ pub trait Fail: Display + Debug + Send + Sync + 'static {
166163
}
167164

168165
#[doc(hidden)]
169-
#[deprecated(
170-
since = "0.1.2",
171-
note = "please use the 'iter_chain()' method instead"
172-
)]
166+
#[deprecated(since = "0.1.2", note = "please use the 'iter_chain()' method instead")]
173167
fn causes(&self) -> Causes
174168
where
175169
Self: Sized,
@@ -259,10 +253,7 @@ impl Fail {
259253
}
260254

261255
/// Deprecated alias to `iter_chain`.
262-
#[deprecated(
263-
since = "0.1.2",
264-
note = "please use the 'iter_chain()' method instead"
265-
)]
256+
#[deprecated(since = "0.1.2", note = "please use the 'iter_chain()' method instead")]
266257
pub fn causes(&self) -> Causes {
267258
Causes { fail: Some(self) }
268259
}

0 commit comments

Comments
 (0)