Skip to content

Commit 0e5848b

Browse files
committed
Reformat uconvert
1 parent 2680c14 commit 0e5848b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/symbolic_dimensions.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@ expand_units(q::QuantityArray) = expand_units.(q)
113113
Convert a quantity `q` with base SI units to the symbolic units of `qout`, for `q` and `qout` with compatible units.
114114
Mathematically, the result has value `q / expand_units(qout)` and units `dimension(qout)`.
115115
"""
116-
function uconvert(qout::AbstractQuantity{T, <:SymbolicDimensions}, q::AbstractQuantity{<:Any, <:Dimensions}) where {T}
116+
function uconvert(qout::AbstractQuantity{<:Any, <:SymbolicDimensions}, q::AbstractQuantity{<:Any, <:Dimensions})
117117
isone(ustrip(qout)) || error("You passed a quantity with a non-unit value to uconvert.")
118118
qout_expanded = expand_units(qout)
119119
dimension(q) == dimension(qout_expanded) || throw(DimensionError(q, qout_expanded))
120-
return new_quantity(typeof(qout), ustrip(q) / ustrip(qout_expanded), dimension(qout))
120+
new_val = ustrip(q) / ustrip(qout_expanded)
121+
new_dim = dimension(qout)
122+
return new_quantity(typeof(q), new_val, new_dim)
121123
end
122124

123125
"""

0 commit comments

Comments
 (0)