Skip to content

Commit ed83b7d

Browse files
committed
Fix Fiber#kill formatting
1 parent 15928e5 commit ed83b7d

2 files changed

Lines changed: 31 additions & 31 deletions

File tree

3.3.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ description: Ruby 3.3 full and annotated changelog
88
# Ruby 3.3
99

1010
* **Released at:** Dec 25, 2023 (<a class="github" href="https://github.com/ruby/ruby/blob/ruby_3_3/NEWS.md">NEWS.md</a> file)
11-
* **Status (as of Dec 27, 2023):** 3.3.0 is recently released
11+
* **Status (as of Dec 28, 2023):** 3.3.0 is recently released
1212
* **This document first published:** Dec 25, 2023
13-
* **Last change to this document:** Dec 27, 2023
13+
* **Last change to this document:** Dec 28, 2023
1414

1515
<!--
1616
* **Reason:**
@@ -430,7 +430,7 @@ A new "weak map" concept implementation. Unlike `ObjectSpace::WeakMap`, it compa
430430
* **Documentation:** <a class="ruby-doc" href="https://docs.ruby-lang.org/en/master/ObjectSpace/WeakKeyMap.html"><code>ObjectSpace::WeakKeyMap</code></a>
431431
* **Code:**
432432
```ruby
433-
map = ObjectSpace::WeekMap.new
433+
map = ObjectSpace::WeakKeyMap.new
434434

435435
key = "foo"
436436
map[key] = true
@@ -739,20 +739,20 @@ Terminates the Fiber by sending an exception inside it.
739739
* **Notes:**
740740
* The exception sent to Fiber is _uncatchable_ (so no `rescue Exception` will notice it), so it can't be said that it has some _class_; the only usage of the fact that it is raised through exception mechanism is invoking `ensure` block;
741741
* The fibers that was invoking the killed one with `resume` or `transfer`, receives `nil` from that call;
742-
```ruby
743-
f1 = Fiber.new {
744-
# Instead of yielding something back, the fiber kills itself
745-
Fiber.current.kill
746-
}
747-
748-
f2 = Fiber.new {
749-
result = f1.transfer
750-
p(result:)
751-
}
752-
753-
f2.resume
754-
# prints: {:result => nil}
755-
```
742+
```ruby
743+
f1 = Fiber.new {
744+
# Instead of yielding something back, the fiber kills itself
745+
Fiber.current.kill
746+
}
747+
748+
f2 = Fiber.new {
749+
result = f1.transfer
750+
p(result:)
751+
}
752+
753+
f2.resume
754+
# prints: {:result => nil}
755+
```
756756
* Only fibers belonging to the same thread can be killed.
757757

758758
### Internals[](#internals)

_src/3.3.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -739,20 +739,20 @@ Terminates the Fiber by sending an exception inside it.
739739
* **Notes:**
740740
* The exception sent to Fiber is _uncatchable_ (so no `rescue Exception` will notice it), so it can't be said that it has some _class_; the only usage of the fact that it is raised through exception mechanism is invoking `ensure` block;
741741
* The fibers that was invoking the killed one with `resume` or `transfer`, receives `nil` from that call;
742-
```ruby
743-
f1 = Fiber.new {
744-
# Instead of yielding something back, the fiber kills itself
745-
Fiber.current.kill
746-
}
747-
748-
f2 = Fiber.new {
749-
result = f1.transfer
750-
p(result:)
751-
}
752-
753-
f2.resume
754-
# prints: {:result => nil}
755-
```
742+
```ruby
743+
f1 = Fiber.new {
744+
# Instead of yielding something back, the fiber kills itself
745+
Fiber.current.kill
746+
}
747+
748+
f2 = Fiber.new {
749+
result = f1.transfer
750+
p(result:)
751+
}
752+
753+
f2.resume
754+
# prints: {:result => nil}
755+
```
756756
* Only fibers belonging to the same thread can be killed.
757757

758758
### Internals

0 commit comments

Comments
 (0)