Skip to content

Commit

Permalink
Delete show(::IO, ::Type) methods. Closes #321 (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Jun 15, 2020
1 parent 1bfdad7 commit ea34378
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ function show(io::IO, mime::MIME"text/plain", x::Quantity)
end
end

function show(io::IO, x::Type{T}) where T<:Quantity
invoke(show, Tuple{IO, typeof(x)}, IOContext(io, :showoperators=>true), x)
end
function show(io::IO, x::Type{T}) where T<:Unitlike
invoke(show, Tuple{IO, typeof(x)}, IOContext(io, :showoperators=>true), x)
end

function show(io::IO, r::Union{StepRange{T},StepRangeLen{T}}) where T<:Quantity
a,s,b = first(r), step(r), last(r)
U = unit(a)
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,9 @@ end
@testset "Display" begin
withenv("UNITFUL_FANCY_EXPONENTS" => false) do
@test string(typeof(1.0m/s)) ==
"Quantity{Float64,𝐋*𝐓^-1,FreeUnits{(m, s^-1),𝐋*𝐓^-1,nothing}}"
"Quantity{Float64,𝐋 𝐓^-1,FreeUnits{(m, s^-1),𝐋 𝐓^-1,nothing}}"
@test string(typeof(m/s)) ==
"FreeUnits{(m, s^-1),𝐋*𝐓^-1,nothing}"
"FreeUnits{(m, s^-1),𝐋 𝐓^-1,nothing}"
@test string(dimension(1u"m/s")) == "𝐋 𝐓^-1"
@test string(NoDims) == "NoDims"
end
Expand Down

0 comments on commit ea34378

Please sign in to comment.