From 75ef98591bfad90786a62607f236e56fc6f0215e Mon Sep 17 00:00:00 2001 From: matthieugomez Date: Fri, 19 May 2017 19:44:34 -0400 Subject: [PATCH] use where --- src/distances/qgram.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/distances/qgram.jl b/src/distances/qgram.jl index 515d471..bb0bc90 100644 --- a/src/distances/qgram.jl +++ b/src/distances/qgram.jl @@ -23,8 +23,8 @@ function Base.done(qgram::QGramIterator, state) istart, idend = state done(qgram.s, idend) end -Base.eltype{S <: AbstractString, T}(qgram::QGramIterator{S, T}) = SubString{typeof(qgram.s)} -Base.eltype{S <: GraphemeIterator, T}(qgram::QGramIterator{S, T}) = SubString{typeof(qgram.s.s)} +Base.eltype(qgram::QGramIterator{S, T}) where {S <: AbstractString, T} = SubString{typeof(qgram.s)} +Base.eltype(qgram::QGramIterator{S, T}) where {S <: GraphemeIterator, T} = SubString{typeof(qgram.s.s)} Base.length(qgram::QGramIterator) = max(qgram.l - qgram.q + 1, 0) function Base.collect(qgram::QGramIterator) x = Array{eltype(qgram)}(length(qgram))