diff --git a/src/conversions.jl b/src/conversions.jl index 5211078d95f..feb4c3a4e71 100644 --- a/src/conversions.jl +++ b/src/conversions.jl @@ -361,7 +361,7 @@ end to_interval(x::Tuple{<: Real, <: Real}) = float_convert(x[1]) .. float_convert(x[2]) to_interval(x::Interval) = float_convert(leftendpoint(x)) .. float_convert(rightendpoint(x)) function to_interval(x::Union{AbstractVector}) - return float_convert(minimum(x)) .. float_convert(maximum(x)) + return float_convert(first(x)) .. float_convert(last(x)) end @@ -649,7 +649,8 @@ end # Helper Functions # ################################################################################ -to_linspace(interval, N) = range(minimum(interval), stop = maximum(interval), length = N) +to_linspace(interval::Interval, N) = range(leftendpoint(interval), stop = rightendpoint(interval), length = N) +to_linspace(x, N) = range(first(x), stop = last(x), length = N) """ Converts the element array type to `T1` without making a copy if the element type matches