From 04cf8b82e9b029018f6690196ba04717ad84ad47 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 29 Oct 2023 22:58:43 -0400 Subject: [PATCH] Modify `each.jl` to use `parse` instead of `tryparse` in the `iterate` function for `EachParsed` There is no possibility when iterating it will return a `nothing` in the current implementation. And ```julia Base.eltype(::Type{EachParsed{T}}) where {T} = T ``` does not let it to return a `Nothing`. Also, using `parse` is more aligned with the name `EachParsed`. --- src/PWscf/output/each.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PWscf/output/each.jl b/src/PWscf/output/each.jl index fc108ab..d07a6ea 100644 --- a/src/PWscf/output/each.jl +++ b/src/PWscf/output/each.jl @@ -87,7 +87,7 @@ function Base.iterate(regexmatchiterator::EachParsed{T}) where {T} return nothing else matched, state = iterated - return tryparse(T, matched.match), state + return parse(T, matched.match), state end end function Base.iterate(regexmatchiterator::EachParsed{T}, state) where {T} @@ -97,7 +97,7 @@ function Base.iterate(regexmatchiterator::EachParsed{T}, state) where {T} return nothing else matched, state = iterated - return tryparse(T, matched.match), state + return parse(T, matched.match), state end end