From eec237e28a8f6d0e2d0dd65bd47ff34b22a52194 Mon Sep 17 00:00:00 2001 From: Max Mumford Date: Wed, 22 Jan 2025 19:17:15 +0000 Subject: [PATCH 1/2] Fix: incorrect code sample `toStream` In the `toStream` section, `toStream` is not actually called, rather `.to(LazyList)`. --- src/main/scala/stdlib/Traversables.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/stdlib/Traversables.scala b/src/main/scala/stdlib/Traversables.scala index d6119e1d..d3708685 100644 --- a/src/main/scala/stdlib/Traversables.scala +++ b/src/main/scala/stdlib/Traversables.scala @@ -195,7 +195,7 @@ object Traversables extends AnyFlatSpec with Matchers with org.scalaexercises.de } /** - * `toStream` will convert any `Traversable` to a `LazyList` where elements are evaluated as they + * `.to(LazyList)` will convert any `Traversable` to a `LazyList` where elements are evaluated as they * are needed: */ def toLazyListFunctionTraversables(res0: Boolean, res1: LazyList[Int]) = { From ee4d8a2590c54c6a0303059557093736874f053d Mon Sep 17 00:00:00 2001 From: Max Mumford Date: Thu, 23 Jan 2025 11:02:59 +0000 Subject: [PATCH 2/2] Fix formatting --- src/main/scala/stdlib/Traversables.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/stdlib/Traversables.scala b/src/main/scala/stdlib/Traversables.scala index d3708685..ac973063 100644 --- a/src/main/scala/stdlib/Traversables.scala +++ b/src/main/scala/stdlib/Traversables.scala @@ -195,8 +195,8 @@ object Traversables extends AnyFlatSpec with Matchers with org.scalaexercises.de } /** - * `.to(LazyList)` will convert any `Traversable` to a `LazyList` where elements are evaluated as they - * are needed: + * `.to(LazyList)` will convert any `Traversable` to a `LazyList` where elements are evaluated as + * they are needed: */ def toLazyListFunctionTraversables(res0: Boolean, res1: LazyList[Int]) = { val list = List(4, 6, 7, 8, 9, 13, 14)