Skip to content

Commit 4f12c12

Browse files
committed
Fix one definition
1 parent 422c166 commit 4f12c12

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/utils.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ end
6868
for f in (:one, :typemin, :typemax)
6969
@eval begin
7070
Base.$f(::Type{Q}) where {T,R,Q<:AbstractQuantity{T,R}} = new_quantity(Q, $f(T), R)
71-
Base.$f(::Type{Q}) where {T,Q<:AbstractQuantity{T}} = $f(Q{T, DEFAULT_DIM_TYPE})
71+
Base.$f(::Type{Q}) where {T,Q<:AbstractQuantity{T}} = $f(constructor_of(Q){T, DEFAULT_DIM_TYPE})
7272
Base.$f(::Type{Q}) where {Q<:AbstractQuantity} = $f(Q{DEFAULT_VALUE_TYPE, DEFAULT_DIM_TYPE})
7373
end
7474
if f == :one # Return empty dimensions, as should be multiplicative identity.
@@ -117,13 +117,11 @@ pretty_print_exponent(io::IO, x) = print(io, to_superscript(string_rational(x)))
117117
const SUPERSCRIPT_MAPPING = ('', '¹', '²', '³', '', '', '', '', '', '')
118118
const INTCHARS = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
119119
to_superscript(s::AbstractString) = join(
120-
map(s) do c
120+
map(replace(s, "//" => "")) do c
121121
if c INTCHARS
122122
SUPERSCRIPT_MAPPING[parse(Int, c)+1]
123-
elseif c == "-"
123+
elseif c == '-'
124124
''
125-
elseif c == "/"
126-
''
127125
else
128126
c
129127
end

0 commit comments

Comments
 (0)