Skip to content

Commit 874d042

Browse files
committed
add Rationals and some code beautifying
1 parent 7d43657 commit 874d042

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fmt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function DefaultSpec(c::AbstractChar, syms...; kwargs...)
2929
end
3030
end
3131

32-
const DEFAULT_FORMATTERS = Dict{Type{T} where T, DefaultSpec}()
32+
const DEFAULT_FORMATTERS = Dict{Type{<:Any}, DefaultSpec}()
3333

3434
# adds a new default formatter for this type
3535
default_spec!(::Type{T}, c::AbstractChar) where {T} =
@@ -83,6 +83,7 @@ default_spec(::Type{<:AbstractFloat}) = DEFAULT_FORMATTERS[AbstractFloat]
8383
default_spec(::Type{<:AbstractString}) = DEFAULT_FORMATTERS[AbstractString]
8484
default_spec(::Type{<:AbstractChar}) = DEFAULT_FORMATTERS[AbstractChar]
8585
default_spec(::Type{<:AbstractIrrational}) = DEFAULT_FORMATTERS[AbstractIrrational]
86+
default_spec(::Type{<:Rational}) = DEFAULT_FORMATTERS[Rational]
8687
default_spec(::Type{<:Number}) = DEFAULT_FORMATTERS[Number]
8788
default_spec(::ComplexInteger) = DEFAULT_FORMATTERS[ComplexInteger]
8889
default_spec(::ComplexFloat) = DEFAULT_FORMATTERS[ComplexFloat]

0 commit comments

Comments
 (0)