Skip to content

Commit

Permalink
Use compiler suggestion no use .view.mapValues(f).toMap instead of …
Browse files Browse the repository at this point in the history
…`mapValues(f)`

Fixes the warning (1):
```
[warn] /home/runner/work/kaitai_struct_compiler/kaitai_struct_compiler/compiler/js/src/main/scala/io/kaitai/struct/format/JavaScriptKSYParser.scala:37:56: method mapValues in trait MapOps is deprecated (since 2.13.0): Use .view.mapValues(f). A future version will include a strict version of this method (for now, .view.mapValues(f).toMap).
[warn]         dict.asInstanceOf[js.Dictionary[AnyRef]].toMap.mapValues(yamlJavascriptToScala)
[warn]                                                        ^
```
  • Loading branch information
Mingun committed Mar 9, 2024
1 parent 05d0221 commit 8c1b63f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object JavaScriptKSYParser {
case _: String | _: Int | _: Double | _: Boolean =>
src
case dict =>
dict.asInstanceOf[js.Dictionary[AnyRef]].toMap.mapValues(yamlJavascriptToScala)
dict.asInstanceOf[js.Dictionary[AnyRef]].toMap.view.mapValues(yamlJavascriptToScala).toMap
}
}
}

0 comments on commit 8c1b63f

Please sign in to comment.