From 0c13b26f4ba6b125d089651afd0517d7f9245935 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Tue, 11 Feb 2020 17:06:00 +0000 Subject: [PATCH] Add Iterator Traits to Paginator --- src/pagination.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pagination.jl b/src/pagination.jl index 3e52010..5b2dca0 100644 --- a/src/pagination.jl +++ b/src/pagination.jl @@ -42,6 +42,10 @@ mutable struct Paginator{T} end end +Base.IteratorSize(::GitForge.Paginator) = Base.SizeUnknown() +Base.IteratorEltype(::GitForge.Paginator) = Base.HasEltype() +Base.eltype(::GitForge.Paginator{T}) where T = T + function paginate( fun::Function, f::Forge, args...; page::Int=1, per_page::Int=100, kwargs...,