Skip to content

Commit e9384e3

Browse files
[autofix.ci] apply automated fixes
1 parent 083f9c6 commit e9384e3

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

any_error/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use std::{
88
cell::RefCell,
99
error,
1010
fmt::{self, Display},
11-
future::Future,
12-
mem, ops,
11+
future::Future, ops,
1312
pin::Pin,
1413
sync::Arc,
1514
task::{Context, Poll},
@@ -108,9 +107,7 @@ pub fn get_error_hook() -> Option<Arc<dyn ErrorHook>> {
108107

109108
/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
110109
pub fn set_error_hook(hook: Arc<dyn ErrorHook>) -> ResetErrorHookOnDrop {
111-
ResetErrorHookOnDrop(
112-
ERROR_HOOK.with_borrow_mut(|this| this.replace(hook)),
113-
)
110+
ResetErrorHookOnDrop(ERROR_HOOK.with_borrow_mut(|this| this.replace(hook)))
114111
}
115112

116113
/// Invokes the error hook set by [`set_error_hook`] with the given error.

reactive_graph/src/owner.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ impl Owner {
207207

208208
/// Runs the given function with this as the current `Owner`.
209209
pub fn with<T>(&self, fun: impl FnOnce() -> T) -> T {
210-
let prev = {
211-
OWNER.with(|o| {
212-
(*o.borrow_mut()).replace(self.clone())
213-
})
214-
};
210+
let prev = { OWNER.with(|o| (*o.borrow_mut()).replace(self.clone())) };
215211
#[cfg(feature = "sandboxed-arenas")]
216212
Arena::set(&self.inner.read().or_poisoned().arena);
217213
let val = fun();

reactive_graph/src/transition.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ impl AsyncTransition {
3737
let (tx, rx) = mpsc::channel();
3838
let global_transition = global_transition();
3939
let inner = TransitionInner { tx };
40-
let prev = (*global_transition.write().or_poisoned()).replace(inner.clone());
40+
let prev =
41+
(*global_transition.write().or_poisoned()).replace(inner.clone());
4142
let value = action().await;
4243
_ = std::mem::replace(
4344
&mut *global_transition.write().or_poisoned(),

0 commit comments

Comments
 (0)