Drop deprecated sequence() and withIndices()
This commit is contained in:
@@ -5,27 +5,6 @@ import templates.Family.*
|
||||
fun mapping(): List<GenericFunction> {
|
||||
val templates = arrayListOf<GenericFunction>()
|
||||
|
||||
templates add f("withIndices()") {
|
||||
deprecate { "Use withIndex() instead." }
|
||||
doc { "Returns a list containing pairs of each element of the original collection and their index." }
|
||||
returns("List<Pair<Int, T>>")
|
||||
body {
|
||||
"""
|
||||
var index = 0
|
||||
return mapTo(ArrayList<Pair<Int, T>>(), { index++ to it })
|
||||
"""
|
||||
}
|
||||
|
||||
returns(Sequences) { "Sequence<Pair<Int, T>>" }
|
||||
doc(Sequences) { "Returns a sequence containing pairs of each element of the original collection and their index." }
|
||||
body(Sequences) {
|
||||
"""
|
||||
var index = 0
|
||||
return TransformingSequence(this, { index++ to it })
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
templates add f("withIndex()") {
|
||||
doc { "Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection." }
|
||||
returns("Iterable<IndexedValue<T>>")
|
||||
|
||||
@@ -5,25 +5,6 @@ import templates.Family.*
|
||||
fun sequences(): List<GenericFunction> {
|
||||
val templates = arrayListOf<GenericFunction>()
|
||||
|
||||
templates add f("sequence()") {
|
||||
include(Maps)
|
||||
exclude(Sequences)
|
||||
deprecate { "Use asSequence() instead" }
|
||||
deprecateReplacement { "asSequence()" }
|
||||
doc { "Returns a sequence from the given collection" }
|
||||
returns("Sequence<T>")
|
||||
body {
|
||||
"""
|
||||
return asSequence()
|
||||
"""
|
||||
}
|
||||
|
||||
body(Sequences) {
|
||||
"""
|
||||
return this
|
||||
"""
|
||||
}
|
||||
}
|
||||
templates add f("asSequence()") {
|
||||
include(Maps)
|
||||
doc { "Returns a sequence from the given collection." }
|
||||
|
||||
Reference in New Issue
Block a user