summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/async_cancel.rs20
-rw-r--r--core/module_specifier.rs2
2 files changed, 11 insertions, 11 deletions
diff --git a/core/async_cancel.rs b/core/async_cancel.rs
index 4c1cded0e..e8f25136c 100644
--- a/core/async_cancel.rs
+++ b/core/async_cancel.rs
@@ -460,18 +460,18 @@ mod internal {
/// must refer to a head (`CancelHandle`) node.
fn cancel(&mut self) {
let mut head_nn = NonNull::from(self);
- let mut item_nn;
// Mark the head node as canceled.
- match replace(unsafe { head_nn.as_mut() }, NodeInner::Canceled) {
- NodeInner::Linked {
- kind: NodeKind::Head { .. },
- next: next_nn,
- ..
- } => item_nn = next_nn,
- NodeInner::Unlinked | NodeInner::Canceled => return,
- _ => unreachable!(),
- };
+ let mut item_nn =
+ match replace(unsafe { head_nn.as_mut() }, NodeInner::Canceled) {
+ NodeInner::Linked {
+ kind: NodeKind::Head { .. },
+ next: next_nn,
+ ..
+ } => next_nn,
+ NodeInner::Unlinked | NodeInner::Canceled => return,
+ _ => unreachable!(),
+ };
// Cancel all item nodes in the chain, waking each stored `Waker`.
while item_nn != head_nn {
diff --git a/core/module_specifier.rs b/core/module_specifier.rs
index d09c4afb5..ecdebbd74 100644
--- a/core/module_specifier.rs
+++ b/core/module_specifier.rs
@@ -397,7 +397,7 @@ mod tests {
// Relative local path.
let expected_url = format!(
"file:///{}/tests/006_url_imports.ts",
- cwd_str.replace("\\", "/")
+ cwd_str.replace('\\', "/")
);
tests.extend(vec![
(r"tests/006_url_imports.ts", expected_url.to_string()),