Skip to content

Commit 26f6d9e

Browse files
committed
Fix a few outdated documentation examples
Changelog: other
1 parent 4b658b4 commit 26f6d9e

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

std/src/std/fs/path.inko

+2-2
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ type pub inline Path {
547547
# let path = Path.new('.')
548548
# let iter = path.list.or_panic('failed to create the iterator')
549549
#
550-
# iter.each fn (result) {
550+
# iter.each(fn (result) {
551551
# match result {
552552
# case Ok({ @path = path, @type = File }) -> {
553553
# out.print(path.to_string)
@@ -556,7 +556,7 @@ type pub inline Path {
556556
# case Ok(_) -> {}
557557
# case Error(err) -> panic(err.to_string)
558558
# }
559-
# }
559+
# })
560560
# ```
561561
fn pub list -> Result[ReadDirectory, Error] {
562562
sys.ReadDirectory.new(@path).map(fn (inner) {

std/src/std/iter.inko

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ trait pub Iter[T] {
3838
# let vals = [10, 20, 30]
3939
# let iter = vals.iter
4040
#
41-
# iter.each fn (num) {
41+
# iter.each(fn (num) {
4242
# num # => 10, 20, 30
43-
# }
43+
# })
4444
# ```
4545
fn pub move each(func: fn (T)) {
4646
loop {
@@ -57,9 +57,9 @@ trait pub Iter[T] {
5757
# # Examples
5858
#
5959
# ```inko
60-
# let res = [10, 0, 30].into_iter.try_each fn (val) {
60+
# let res = [10, 0, 30].into_iter.try_each(fn (val) {
6161
# if val > 0 { Result.Ok(nil) } else { Result.Error('test') }
62-
# }
62+
# })
6363
#
6464
# res # => Result.Error('test')
6565
# ```
@@ -81,10 +81,10 @@ trait pub Iter[T] {
8181
# let vals = [10, 20, 30]
8282
# let iter = vals.iter
8383
#
84-
# iter.each_with_index fn (index, num) {
84+
# iter.each_with_index(fn (index, num) {
8585
# index # => 0, 1, 2
8686
# num # => 10, 20, 30
87-
# }
87+
# })
8888
# ```
8989
fn pub move each_with_index(func: fn (Int, T)) {
9090
let mut idx = 0

std/src/std/map.inko

+12-12
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ type pub Map[K: Equal + Hash, V] {
223223
#
224224
# map.set('name', 'Alice')
225225
#
226-
# map.iter.each fn (entry) {
226+
# map.iter.each(fn (entry) {
227227
# entry.key # => 'name'
228228
# entry.value # => 'Alice'
229-
# }
229+
# })
230230
# ```
231231
fn pub iter -> Stream[ref Entry[K, V]] {
232232
@entries.iter
@@ -243,10 +243,10 @@ type pub Map[K: Equal + Hash, V] {
243243
#
244244
# map.set('name', 'Alice')
245245
#
246-
# map.iter_mut.each fn (entry) {
246+
# map.iter_mut.each(fn (entry) {
247247
# entry.key # => 'name'
248248
# entry.value # => 'Alice'
249-
# }
249+
# })
250250
# ```
251251
fn pub mut iter_mut -> Stream[mut Entry[K, V]] {
252252
@entries.iter_mut
@@ -262,10 +262,10 @@ type pub Map[K: Equal + Hash, V] {
262262
#
263263
# map.set('name', 'Alice')
264264
#
265-
# map.into_iter.each fn (e) {
265+
# map.into_iter.each(fn (e) {
266266
# e.key # => 'name'
267267
# e.value # => 'Alice'
268-
# }
268+
# })
269269
# ```
270270
fn pub move into_iter -> IntoIter[Entry[K, V]] {
271271
@entries.into_iter
@@ -282,9 +282,9 @@ type pub Map[K: Equal + Hash, V] {
282282
#
283283
# map.set('name', 'Alice')
284284
#
285-
# map.keys.each fn (key) {
285+
# map.keys.each(fn (key) {
286286
# key # => 'name'
287-
# }
287+
# })
288288
# ```
289289
fn pub keys -> Stream[ref K] {
290290
iter.map(fn (e) { e.key })
@@ -302,9 +302,9 @@ type pub Map[K: Equal + Hash, V] {
302302
#
303303
# map.set('name', 'Alice')
304304
#
305-
# map.values.each fn (value) {
305+
# map.values.each(fn (value) {
306306
# value # => 'Alice'
307-
# }
307+
# })
308308
# ```
309309
fn pub values -> Stream[ref V] {
310310
iter.map(fn (e) { e.value })
@@ -638,9 +638,9 @@ impl Map if V: mut {
638638
#
639639
# map.set('name', 'Alice')
640640
#
641-
# map.values_mut.each fn (value) {
641+
# map.values_mut.each(fn (value) {
642642
# value # => 'Alice'
643-
# }
643+
# })
644644
# ```
645645
fn pub mut values_mut -> Stream[mut V] {
646646
iter_mut.map(fn (e) { e.value })

0 commit comments

Comments
 (0)