Skip to content

Commit d7c9730

Browse files
committed
Fix deprecated syntax
1 parent 4c6fd1a commit d7c9730

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/TableTraitsUtils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export create_tableiterator, create_columns_from_iterabletable
66

77
# T is the type of the elements produced
88
# TS is a tuple type that stores the columns of the table
9-
immutable TableIterator{T, TS}
9+
struct TableIterator{T, TS}
1010
columns::TS
1111
end
1212

@@ -35,19 +35,19 @@ function create_tableiterator(columns, names::Vector{Symbol})
3535
return e_df
3636
end
3737

38-
function Base.length{T,TS}(iter::TableIterator{T,TS})
38+
function Base.length(iter::TableIterator{T,TS}) where {T,TS}
3939
return length(iter.columns[1])
4040
end
4141

42-
function Base.eltype{T,TS}(iter::TableIterator{T,TS})
42+
function Base.eltype(iter::TableIterator{T,TS}) where {T,TS}
4343
return T
4444
end
4545

46-
function Base.start{T,TS}(iter::TableIterator{T,TS})
46+
function Base.start(iter::TableIterator{T,TS}) where {T,TS}
4747
return 1
4848
end
4949

50-
@generated function Base.next{T,TS}(iter::TableIterator{T,TS}, state)
50+
@generated function Base.next(iter::TableIterator{T,TS}, state) where {T,TS}
5151
constructor_call = Expr(:call, :($T))
5252
for (i,t) in enumerate(T.parameters)
5353
if eltype(iter.parameters[2].parameters[i]) <: Nullable
@@ -65,7 +65,7 @@ end
6565
end
6666
end
6767

68-
function Base.done{T,TS}(iter::TableIterator{T,TS}, state)
68+
function Base.done(iter::TableIterator{T,TS}, state) where {T,TS}
6969
return state>length(iter.columns[1])
7070
end
7171

test/test_source_without_length.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Base.eltype(iter::TestSourceWithoutLength)
77
return @NT(a::Int, b::Float64)
88
end
99

10-
Base.iteratorsize{T<:TestSourceWithoutLength}(::Type{T}) = Base.SizeUnknown()
10+
Base.iteratorsize(::Type{T}) where {T <: TestSourceWithoutLength} = Base.SizeUnknown()
1111

1212
function Base.start(iter::TestSourceWithoutLength)
1313
return 1

0 commit comments

Comments
 (0)