Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com>
  • Loading branch information
pabloferz and omus committed Feb 19, 2022
1 parent ee77d7a commit 03a4ecd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ end
only(interval::AbstractInterval)
Returns the only element of a closed interval with coinciding endpoints (throws a
DomainError otherwise).
`DomainError` otherwise).
"""
function Base.only(interval::Interval)
function Base.only(interval::AbstractInterval)
if first(interval) == last(interval) && isclosed(interval)
return first(interval)
else
Expand Down
2 changes: 1 addition & 1 deletion test/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
@test hash(a) == hash(b)
end

@testset "conversion" begin
@testset "only" begin
@test_throws DomainError only(Interval{Open, Open}(10, 10))
@test_throws DomainError only(Interval{Open, Closed}(10, 10))
@test_throws DomainError only(Interval{Closed, Open}(10, 10))
Expand Down

0 comments on commit 03a4ecd

Please sign in to comment.